##// END OF EJS Templates
Last set of Rocky's patches for pydb integration
vivainio -
Show More
@@ -1,315 +1,411 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 Pdb debugger class.
3 Pdb debugger class.
4
4
5 Modified from the standard pdb.Pdb class to avoid including readline, so that
5 Modified from the standard pdb.Pdb class to avoid including readline, so that
6 the command line completion of other programs which include this isn't
6 the command line completion of other programs which include this isn't
7 damaged.
7 damaged.
8
8
9 In the future, this class will be expanded with improvements over the standard
9 In the future, this class will be expanded with improvements over the standard
10 pdb.
10 pdb.
11
11
12 The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor
12 The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor
13 changes. Licensing should therefore be under the standard Python terms. For
13 changes. Licensing should therefore be under the standard Python terms. For
14 details on the PSF (Python Software Foundation) standard license, see:
14 details on the PSF (Python Software Foundation) standard license, see:
15
15
16 http://www.python.org/2.2.3/license.html
16 http://www.python.org/2.2.3/license.html
17
17
18 $Id: Debugger.py 1787 2006-09-27 06:56:29Z fperez $"""
18 $Id: Debugger.py 1853 2006-10-30 17:00:39Z vivainio $"""
19
19
20 #*****************************************************************************
20 #*****************************************************************************
21 #
21 #
22 # Since this file is essentially a modified copy of the pdb module which is
22 # Since this file is essentially a modified copy of the pdb module which is
23 # part of the standard Python distribution, I assume that the proper procedure
23 # part of the standard Python distribution, I assume that the proper procedure
24 # is to maintain its copyright as belonging to the Python Software Foundation
24 # is to maintain its copyright as belonging to the Python Software Foundation
25 # (in addition to my own, for all new code).
25 # (in addition to my own, for all new code).
26 #
26 #
27 # Copyright (C) 2001 Python Software Foundation, www.python.org
27 # Copyright (C) 2001 Python Software Foundation, www.python.org
28 # Copyright (C) 2005-2006 Fernando Perez. <fperez@colorado.edu>
28 # Copyright (C) 2005-2006 Fernando Perez. <fperez@colorado.edu>
29 #
29 #
30 # Distributed under the terms of the BSD License. The full license is in
30 # Distributed under the terms of the BSD License. The full license is in
31 # the file COPYING, distributed as part of this software.
31 # the file COPYING, distributed as part of this software.
32 #
32 #
33 #*****************************************************************************
33 #*****************************************************************************
34
34
35 from IPython import Release
35 from IPython import Release
36 __author__ = '%s <%s>' % Release.authors['Fernando']
36 __author__ = '%s <%s>' % Release.authors['Fernando']
37 __license__ = 'Python'
37 __license__ = 'Python'
38
38
39 import bdb
39 import bdb
40 import cmd
40 import cmd
41 import linecache
41 import linecache
42 import os
42 import os
43 import pdb
44 import sys
43 import sys
45
44
46 from IPython import PyColorize, ColorANSI
45 from IPython import PyColorize, ColorANSI
47 from IPython.genutils import Term
46 from IPython.genutils import Term
48 from IPython.excolors import ExceptionColors
47 from IPython.excolors import ExceptionColors
49
48
49 # See if we can use pydb.
50 has_pydb = False
51 prompt = 'ipdb>'
52 if sys.version[:3] >= '2.5':
53 try:
54 import pydb
55 if hasattr(pydb.pydb, "runl"):
56 has_pydb = True
57 from pydb import Pdb as OldPdb
58 prompt = 'ipydb>'
59 except ImportError:
60 pass
61
62 if has_pydb:
63 from pydb import Pdb as OldPdb
64 else:
65 from pdb import Pdb as OldPdb
66
67 def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
68 """Make new_fn have old_fn's doc string. This is particularly useful
69 for the do_... commands that hook into the help system.
70 Adapted from from a comp.lang.python posting
71 by Duncan Booth."""
72 def wrapper(*args, **kw):
73 return new_fn(*args, **kw)
74 if old_fn.__doc__:
75 wrapper.__doc__ = old_fn.__doc__ + additional_text
76 return wrapper
77
50 def _file_lines(fname):
78 def _file_lines(fname):
51 """Return the contents of a named file as a list of lines.
79 """Return the contents of a named file as a list of lines.
52
80
53 This function never raises an IOError exception: if the file can't be
81 This function never raises an IOError exception: if the file can't be
54 read, it simply returns an empty list."""
82 read, it simply returns an empty list."""
55
83
56 try:
84 try:
57 outfile = open(fname)
85 outfile = open(fname)
58 except IOError:
86 except IOError:
59 return []
87 return []
60 else:
88 else:
61 out = outfile.readlines()
89 out = outfile.readlines()
62 outfile.close()
90 outfile.close()
63 return out
91 return out
64
92
65 class Pdb(pdb.Pdb):
93 class Pdb(OldPdb):
66 """Modified Pdb class, does not load readline."""
94 """Modified Pdb class, does not load readline."""
67
95
68 if sys.version[:3] >= '2.5':
96 if sys.version[:3] >= '2.5':
69 def __init__(self,color_scheme='NoColor',completekey=None,
97 def __init__(self,color_scheme='NoColor',completekey=None,
70 stdin=None, stdout=None):
98 stdin=None, stdout=None):
71
99
72 # Parent constructor:
100 # Parent constructor:
73 pdb.Pdb.__init__(self,completekey,stdin,stdout)
101 OldPdb.__init__(self,completekey,stdin,stdout)
74
102
75 # IPython changes...
103 # IPython changes...
76 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
104 self.prompt = prompt # The default prompt is '(Pdb)'
105 self.is_pydb = prompt == 'ipydb>'
106
107 if self.is_pydb:
108
109 # iplib.py's ipalias seems to want pdb's checkline
110 # which located in pydb.fn
111 import pydb.fns
112 self.checkline = lambda filename, lineno: \
113 pydb.fns.checkline(self, filename, lineno)
114
115 self.curframe = None
116 self.do_restart = self.new_do_restart
117
118 self.old_all_completions = __IPYTHON__.Completer.all_completions
119 __IPYTHON__.Completer.all_completions=self.all_completions
120
121 # Do we have access to pydb's list command parser?
122 self.do_list = decorate_fn_with_doc(self.list_command_pydb,
123 OldPdb.do_list)
124 self.do_l = self.do_list
125 self.do_frame = decorate_fn_with_doc(self.new_do_frame,
126 OldPdb.do_frame)
127
77 self.aliases = {}
128 self.aliases = {}
78
129
79 # Create color table: we copy the default one from the traceback
130 # Create color table: we copy the default one from the traceback
80 # module and add a few attributes needed for debugging
131 # module and add a few attributes needed for debugging
81 self.color_scheme_table = ExceptionColors.copy()
132 self.color_scheme_table = ExceptionColors.copy()
82
133
83 # shorthands
134 # shorthands
84 C = ColorANSI.TermColors
135 C = ColorANSI.TermColors
85 cst = self.color_scheme_table
136 cst = self.color_scheme_table
86
137
87 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
138 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
88 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
139 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
89
140
90 cst['Linux'].colors.breakpoint_enabled = C.LightRed
141 cst['Linux'].colors.breakpoint_enabled = C.LightRed
91 cst['Linux'].colors.breakpoint_disabled = C.Red
142 cst['Linux'].colors.breakpoint_disabled = C.Red
92
143
93 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
144 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
94 cst['LightBG'].colors.breakpoint_disabled = C.Red
145 cst['LightBG'].colors.breakpoint_disabled = C.Red
95
146
96 self.set_colors(color_scheme)
147 self.set_colors(color_scheme)
97
148
98 else:
149 else:
99 # Ugly hack: for Python 2.3-2.4, we can't call the parent constructor,
150 # Ugly hack: for Python 2.3-2.4, we can't call the parent constructor,
100 # because it binds readline and breaks tab-completion. This means we
151 # because it binds readline and breaks tab-completion. This means we
101 # have to COPY the constructor here.
152 # have to COPY the constructor here.
102 def __init__(self,color_scheme='NoColor'):
153 def __init__(self,color_scheme='NoColor'):
103 bdb.Bdb.__init__(self)
154 bdb.Bdb.__init__(self)
104 cmd.Cmd.__init__(self,completekey=None) # don't load readline
155 cmd.Cmd.__init__(self,completekey=None) # don't load readline
105 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
156 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
106 self.aliases = {}
157 self.aliases = {}
107
158
108 # These two lines are part of the py2.4 constructor, let's put them
159 # These two lines are part of the py2.4 constructor, let's put them
109 # unconditionally here as they won't cause any problems in 2.3.
160 # unconditionally here as they won't cause any problems in 2.3.
110 self.mainpyfile = ''
161 self.mainpyfile = ''
111 self._wait_for_mainpyfile = 0
162 self._wait_for_mainpyfile = 0
112
163
113 # Read $HOME/.pdbrc and ./.pdbrc
164 # Read $HOME/.pdbrc and ./.pdbrc
114 try:
165 try:
115 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
166 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
116 ".pdbrc"))
167 ".pdbrc"))
117 except KeyError:
168 except KeyError:
118 self.rcLines = []
169 self.rcLines = []
119 self.rcLines.extend(_file_lines(".pdbrc"))
170 self.rcLines.extend(_file_lines(".pdbrc"))
120
171
121 # Create color table: we copy the default one from the traceback
172 # Create color table: we copy the default one from the traceback
122 # module and add a few attributes needed for debugging
173 # module and add a few attributes needed for debugging
123 self.color_scheme_table = ExceptionColors.copy()
174 self.color_scheme_table = ExceptionColors.copy()
124
175
125 # shorthands
176 # shorthands
126 C = ColorANSI.TermColors
177 C = ColorANSI.TermColors
127 cst = self.color_scheme_table
178 cst = self.color_scheme_table
128
179
129 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
180 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
130 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
181 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
131
182
132 cst['Linux'].colors.breakpoint_enabled = C.LightRed
183 cst['Linux'].colors.breakpoint_enabled = C.LightRed
133 cst['Linux'].colors.breakpoint_disabled = C.Red
184 cst['Linux'].colors.breakpoint_disabled = C.Red
134
185
135 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
186 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
136 cst['LightBG'].colors.breakpoint_disabled = C.Red
187 cst['LightBG'].colors.breakpoint_disabled = C.Red
137
188
138 self.set_colors(color_scheme)
189 self.set_colors(color_scheme)
139
190
140 def set_colors(self, scheme):
191 def set_colors(self, scheme):
141 """Shorthand access to the color table scheme selector method."""
192 """Shorthand access to the color table scheme selector method."""
142 self.color_scheme_table.set_active_scheme(scheme)
193 self.color_scheme_table.set_active_scheme(scheme)
143
194
144 def interaction(self, frame, traceback):
195 def interaction(self, frame, traceback):
145 __IPYTHON__.set_completer_frame(frame)
196 __IPYTHON__.set_completer_frame(frame)
146 pdb.Pdb.interaction(self, frame, traceback)
197 OldPdb.interaction(self, frame, traceback)
198
199 def new_do_up(self, arg):
200 OldPdb.do_up(self, arg)
201 __IPYTHON__.set_completer_frame(self.curframe)
202 do_u = do_up = decorate_fn_with_doc(new_do_up, OldPdb.do_up)
147
203
148 def do_up(self, arg):
204 def new_do_down(self, arg):
149 pdb.Pdb.do_up(self, arg)
205 OldPdb.do_down(self, arg)
150 __IPYTHON__.set_completer_frame(self.curframe)
206 __IPYTHON__.set_completer_frame(self.curframe)
151 do_u = do_up
152
207
153 def do_down(self, arg):
208 do_d = do_down = decorate_fn_with_doc(new_do_down, OldPdb.do_down)
154 pdb.Pdb.do_down(self, arg)
209
210 def new_do_frame(self, arg):
211 OldPdb.do_frame(self, arg)
155 __IPYTHON__.set_completer_frame(self.curframe)
212 __IPYTHON__.set_completer_frame(self.curframe)
156 do_d = do_down
213
214 def new_do_quit(self, arg):
215 __IPYTHON__.Completer.all_completions=self.old_all_completions
216 return OldPdb.do_quit(self, arg)
217
218 do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit)
219
220 def new_do_restart(self, arg):
221 """Restart command. In the context of ipython this is exactly the same
222 thing as 'quit'."""
223 self.msg("Restart doesn't make sense here. Using 'quit' instead.")
224 return self.do_quit(arg)
157
225
158 def postloop(self):
226 def postloop(self):
159 __IPYTHON__.set_completer_frame(None)
227 __IPYTHON__.set_completer_frame(None)
160
228
161 def print_stack_trace(self):
229 def print_stack_trace(self):
162 try:
230 try:
163 for frame_lineno in self.stack:
231 for frame_lineno in self.stack:
164 self.print_stack_entry(frame_lineno, context = 5)
232 self.print_stack_entry(frame_lineno, context = 5)
165 except KeyboardInterrupt:
233 except KeyboardInterrupt:
166 pass
234 pass
167
235
168 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
236 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
169 context = 3):
237 context = 3):
170 frame, lineno = frame_lineno
238 frame, lineno = frame_lineno
171 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
239 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
172
240
173 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
241 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
174 import linecache, repr
242 import linecache, repr
175
243
176 ret = []
244 ret = []
177
245
178 Colors = self.color_scheme_table.active_colors
246 Colors = self.color_scheme_table.active_colors
179 ColorsNormal = Colors.Normal
247 ColorsNormal = Colors.Normal
180 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
248 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
181 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
249 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
182 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
250 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
183 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
251 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
184 ColorsNormal)
252 ColorsNormal)
185
253
186 frame, lineno = frame_lineno
254 frame, lineno = frame_lineno
187
255
188 return_value = ''
256 return_value = ''
189 if '__return__' in frame.f_locals:
257 if '__return__' in frame.f_locals:
190 rv = frame.f_locals['__return__']
258 rv = frame.f_locals['__return__']
191 #return_value += '->'
259 #return_value += '->'
192 return_value += repr.repr(rv) + '\n'
260 return_value += repr.repr(rv) + '\n'
193 ret.append(return_value)
261 ret.append(return_value)
194
262
195 #s = filename + '(' + `lineno` + ')'
263 #s = filename + '(' + `lineno` + ')'
196 filename = self.canonic(frame.f_code.co_filename)
264 filename = self.canonic(frame.f_code.co_filename)
197 link = tpl_link % filename
265 link = tpl_link % filename
198
266
199 if frame.f_code.co_name:
267 if frame.f_code.co_name:
200 func = frame.f_code.co_name
268 func = frame.f_code.co_name
201 else:
269 else:
202 func = "<lambda>"
270 func = "<lambda>"
203
271
204 call = ''
272 call = ''
205 if func != '?':
273 if func != '?':
206 if '__args__' in frame.f_locals:
274 if '__args__' in frame.f_locals:
207 args = repr.repr(frame.f_locals['__args__'])
275 args = repr.repr(frame.f_locals['__args__'])
208 else:
276 else:
209 args = '()'
277 args = '()'
210 call = tpl_call % (func, args)
278 call = tpl_call % (func, args)
211
279
212 # The level info should be generated in the same format pdb uses, to
280 # The level info should be generated in the same format pdb uses, to
213 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
281 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
214 ret.append('> %s(%s)%s\n' % (link,lineno,call))
282 ret.append('> %s(%s)%s\n' % (link,lineno,call))
215
283
216 start = lineno - 1 - context//2
284 start = lineno - 1 - context//2
217 lines = linecache.getlines(filename)
285 lines = linecache.getlines(filename)
218 start = max(start, 0)
286 start = max(start, 0)
219 start = min(start, len(lines) - context)
287 start = min(start, len(lines) - context)
220 lines = lines[start : start + context]
288 lines = lines[start : start + context]
221
289
222 for i,line in enumerate(lines):
290 for i,line in enumerate(lines):
223 show_arrow = (start + 1 + i == lineno)
291 show_arrow = (start + 1 + i == lineno)
224 ret.append(self.__format_line(tpl_line_em, filename,
292 ret.append(self.__format_line(tpl_line_em, filename,
225 start + 1 + i, line,
293 start + 1 + i, line,
226 arrow = show_arrow) )
294 arrow = show_arrow) )
227
295
228 return ''.join(ret)
296 return ''.join(ret)
229
297
230 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
298 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
231 bp_mark = ""
299 bp_mark = ""
232 bp_mark_color = ""
300 bp_mark_color = ""
233
301
234 bp = None
302 bp = None
235 if lineno in self.get_file_breaks(filename):
303 if lineno in self.get_file_breaks(filename):
236 bps = self.get_breaks(filename, lineno)
304 bps = self.get_breaks(filename, lineno)
237 bp = bps[-1]
305 bp = bps[-1]
238
306
239 if bp:
307 if bp:
240 Colors = self.color_scheme_table.active_colors
308 Colors = self.color_scheme_table.active_colors
241 bp_mark = str(bp.number)
309 bp_mark = str(bp.number)
242 bp_mark_color = Colors.breakpoint_enabled
310 bp_mark_color = Colors.breakpoint_enabled
243 if not bp.enabled:
311 if not bp.enabled:
244 bp_mark_color = Colors.breakpoint_disabled
312 bp_mark_color = Colors.breakpoint_disabled
245
313
246 numbers_width = 7
314 numbers_width = 7
247 if arrow:
315 if arrow:
248 # This is the line with the error
316 # This is the line with the error
249 pad = numbers_width - len(str(lineno)) - len(bp_mark)
317 pad = numbers_width - len(str(lineno)) - len(bp_mark)
250 if pad >= 3:
318 if pad >= 3:
251 marker = '-'*(pad-3) + '-> '
319 marker = '-'*(pad-3) + '-> '
252 elif pad == 2:
320 elif pad == 2:
253 marker = '> '
321 marker = '> '
254 elif pad == 1:
322 elif pad == 1:
255 marker = '>'
323 marker = '>'
256 else:
324 else:
257 marker = ''
325 marker = ''
258 num = '%s%s' % (marker, str(lineno))
326 num = '%s%s' % (marker, str(lineno))
259 line = tpl_line % (bp_mark_color + bp_mark, num, line)
327 line = tpl_line % (bp_mark_color + bp_mark, num, line)
260 else:
328 else:
261 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
329 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
262 line = tpl_line % (bp_mark_color + bp_mark, num, line)
330 line = tpl_line % (bp_mark_color + bp_mark, num, line)
263
331
264 return line
332 return line
265
333
334 def list_command_pydb(self, arg):
335 """List command to use if we have a newer pydb installed"""
336 filename, first, last = OldPdb.parse_list_cmd(self, arg)
337 if filename is not None:
338 self.print_list_lines(filename, first, last)
339
340 def print_list_lines(self, filename, first, last):
341 """The printing (as opposed to the parsing part of a 'list'
342 command."""
343 try:
344 Colors = self.color_scheme_table.active_colors
345 ColorsNormal = Colors.Normal
346 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
347 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
348 src = []
349 for lineno in range(first, last+1):
350 line = linecache.getline(filename, lineno)
351 if not line:
352 break
353
354 if lineno == self.curframe.f_lineno:
355 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
356 else:
357 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
358
359 src.append(line)
360 self.lineno = lineno
361
362 print >>Term.cout, ''.join(src)
363
364 except KeyboardInterrupt:
365 pass
366
266 def do_list(self, arg):
367 def do_list(self, arg):
267 self.lastcmd = 'list'
368 self.lastcmd = 'list'
268 last = None
369 last = None
269 if arg:
370 if arg:
270 try:
371 try:
271 x = eval(arg, {}, {})
372 x = eval(arg, {}, {})
272 if type(x) == type(()):
373 if type(x) == type(()):
273 first, last = x
374 first, last = x
274 first = int(first)
375 first = int(first)
275 last = int(last)
376 last = int(last)
276 if last < first:
377 if last < first:
277 # Assume it's a count
378 # Assume it's a count
278 last = first + last
379 last = first + last
279 else:
380 else:
280 first = max(1, int(x) - 5)
381 first = max(1, int(x) - 5)
281 except:
382 except:
282 print '*** Error in argument:', `arg`
383 print '*** Error in argument:', `arg`
283 return
384 return
284 elif self.lineno is None:
385 elif self.lineno is None:
285 first = max(1, self.curframe.f_lineno - 5)
386 first = max(1, self.curframe.f_lineno - 5)
286 else:
387 else:
287 first = self.lineno + 1
388 first = self.lineno + 1
288 if last is None:
389 if last is None:
289 last = first + 10
390 last = first + 10
290 filename = self.curframe.f_code.co_filename
391 self.print_list_lines(self.curframe.f_code.co_filename, first, last)
291 try:
292 Colors = self.color_scheme_table.active_colors
293 ColorsNormal = Colors.Normal
294 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
295 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
296 src = []
297 for lineno in range(first, last+1):
298 line = linecache.getline(filename, lineno)
299 if not line:
300 break
301
302 if lineno == self.curframe.f_lineno:
303 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
304 else:
305 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
306
307 src.append(line)
308 self.lineno = lineno
309
310 print >>Term.cout, ''.join(src)
311
312 except KeyboardInterrupt:
313 pass
314
392
315 do_l = do_list
393 do_l = do_list
394
395 def do_pdef(self, arg):
396 """The debugger interface to magic_pdef"""
397 namespaces = [('Locals', self.curframe.f_locals),
398 ('Globals', self.curframe.f_globals)]
399 __IPYTHON__.magic_pdef(arg, namespaces=namespaces)
400
401 def do_pdoc(self, arg):
402 """The debugger interface to magic_pdoc"""
403 namespaces = [('Locals', self.curframe.f_locals),
404 ('Globals', self.curframe.f_globals)]
405 __IPYTHON__.magic_pdoc(arg, namespaces=namespaces)
406
407 def do_pinfo(self, arg):
408 """The debugger equivalant of ?obj"""
409 namespaces = [('Locals', self.curframe.f_locals),
410 ('Globals', self.curframe.f_globals)]
411 __IPYTHON__.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
@@ -1,2434 +1,2442 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 1850 2006-10-28 19:48:13Z fptest $
9 $Id: iplib.py 1853 2006-10-30 17:00:39Z 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 exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import pdb
51 import pydoc
50 import pydoc
52 import re
51 import re
53 import shutil
52 import shutil
54 import string
53 import string
55 import sys
54 import sys
56 import tempfile
55 import tempfile
57 import traceback
56 import traceback
58 import types
57 import types
59 import pickleshare
58 import pickleshare
60 from sets import Set
59 from sets import Set
61 from pprint import pprint, pformat
60 from pprint import pprint, pformat
62
61
63 # IPython's own modules
62 # IPython's own modules
64 import IPython
63 import IPython
65 from IPython import OInspect,PyColorize,ultraTB
64 from IPython import OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
65 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
66 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
68 from IPython.Logger import Logger
70 from IPython.Magic import Magic
69 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
70 from IPython.Prompts import CachedOutput
72 from IPython.ipstruct import Struct
71 from IPython.ipstruct import Struct
73 from IPython.background_jobs import BackgroundJobManager
72 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
73 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
74 from IPython.genutils import *
76 import IPython.ipapi
75 import IPython.ipapi
77
76
78 # Globals
77 # Globals
79
78
80 # store the builtin raw_input globally, and use this always, in case user code
79 # store the builtin raw_input globally, and use this always, in case user code
81 # overwrites it (like wx.py.PyShell does)
80 # overwrites it (like wx.py.PyShell does)
82 raw_input_original = raw_input
81 raw_input_original = raw_input
83
82
84 # compiled regexps for autoindent management
83 # compiled regexps for autoindent management
85 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
84 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
86
85
87
86
88 #****************************************************************************
87 #****************************************************************************
89 # Some utility function definitions
88 # Some utility function definitions
90
89
91 ini_spaces_re = re.compile(r'^(\s+)')
90 ini_spaces_re = re.compile(r'^(\s+)')
92
91
93 def num_ini_spaces(strng):
92 def num_ini_spaces(strng):
94 """Return the number of initial spaces in a string"""
93 """Return the number of initial spaces in a string"""
95
94
96 ini_spaces = ini_spaces_re.match(strng)
95 ini_spaces = ini_spaces_re.match(strng)
97 if ini_spaces:
96 if ini_spaces:
98 return ini_spaces.end()
97 return ini_spaces.end()
99 else:
98 else:
100 return 0
99 return 0
101
100
102 def softspace(file, newvalue):
101 def softspace(file, newvalue):
103 """Copied from code.py, to remove the dependency"""
102 """Copied from code.py, to remove the dependency"""
104
103
105 oldvalue = 0
104 oldvalue = 0
106 try:
105 try:
107 oldvalue = file.softspace
106 oldvalue = file.softspace
108 except AttributeError:
107 except AttributeError:
109 pass
108 pass
110 try:
109 try:
111 file.softspace = newvalue
110 file.softspace = newvalue
112 except (AttributeError, TypeError):
111 except (AttributeError, TypeError):
113 # "attribute-less object" or "read-only attributes"
112 # "attribute-less object" or "read-only attributes"
114 pass
113 pass
115 return oldvalue
114 return oldvalue
116
115
117
116
118 #****************************************************************************
117 #****************************************************************************
119 # Local use exceptions
118 # Local use exceptions
120 class SpaceInInput(exceptions.Exception): pass
119 class SpaceInInput(exceptions.Exception): pass
121
120
122
121
123 #****************************************************************************
122 #****************************************************************************
124 # Local use classes
123 # Local use classes
125 class Bunch: pass
124 class Bunch: pass
126
125
127 class Undefined: pass
126 class Undefined: pass
128
127
129 class Quitter(object):
128 class Quitter(object):
130 """Simple class to handle exit, similar to Python 2.5's.
129 """Simple class to handle exit, similar to Python 2.5's.
131
130
132 It handles exiting in an ipython-safe manner, which the one in Python 2.5
131 It handles exiting in an ipython-safe manner, which the one in Python 2.5
133 doesn't do (obviously, since it doesn't know about ipython)."""
132 doesn't do (obviously, since it doesn't know about ipython)."""
134
133
135 def __init__(self,shell,name):
134 def __init__(self,shell,name):
136 self.shell = shell
135 self.shell = shell
137 self.name = name
136 self.name = name
138
137
139 def __repr__(self):
138 def __repr__(self):
140 return 'Type %s() to exit.' % self.name
139 return 'Type %s() to exit.' % self.name
141 __str__ = __repr__
140 __str__ = __repr__
142
141
143 def __call__(self):
142 def __call__(self):
144 self.shell.exit()
143 self.shell.exit()
145
144
146 class InputList(list):
145 class InputList(list):
147 """Class to store user input.
146 """Class to store user input.
148
147
149 It's basically a list, but slices return a string instead of a list, thus
148 It's basically a list, but slices return a string instead of a list, thus
150 allowing things like (assuming 'In' is an instance):
149 allowing things like (assuming 'In' is an instance):
151
150
152 exec In[4:7]
151 exec In[4:7]
153
152
154 or
153 or
155
154
156 exec In[5:9] + In[14] + In[21:25]"""
155 exec In[5:9] + In[14] + In[21:25]"""
157
156
158 def __getslice__(self,i,j):
157 def __getslice__(self,i,j):
159 return ''.join(list.__getslice__(self,i,j))
158 return ''.join(list.__getslice__(self,i,j))
160
159
161 class SyntaxTB(ultraTB.ListTB):
160 class SyntaxTB(ultraTB.ListTB):
162 """Extension which holds some state: the last exception value"""
161 """Extension which holds some state: the last exception value"""
163
162
164 def __init__(self,color_scheme = 'NoColor'):
163 def __init__(self,color_scheme = 'NoColor'):
165 ultraTB.ListTB.__init__(self,color_scheme)
164 ultraTB.ListTB.__init__(self,color_scheme)
166 self.last_syntax_error = None
165 self.last_syntax_error = None
167
166
168 def __call__(self, etype, value, elist):
167 def __call__(self, etype, value, elist):
169 self.last_syntax_error = value
168 self.last_syntax_error = value
170 ultraTB.ListTB.__call__(self,etype,value,elist)
169 ultraTB.ListTB.__call__(self,etype,value,elist)
171
170
172 def clear_err_state(self):
171 def clear_err_state(self):
173 """Return the current error state and clear it"""
172 """Return the current error state and clear it"""
174 e = self.last_syntax_error
173 e = self.last_syntax_error
175 self.last_syntax_error = None
174 self.last_syntax_error = None
176 return e
175 return e
177
176
178 #****************************************************************************
177 #****************************************************************************
179 # Main IPython class
178 # Main IPython class
180
179
181 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
180 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
182 # until a full rewrite is made. I've cleaned all cross-class uses of
181 # until a full rewrite is made. I've cleaned all cross-class uses of
183 # attributes and methods, but too much user code out there relies on the
182 # attributes and methods, but too much user code out there relies on the
184 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
183 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
185 #
184 #
186 # But at least now, all the pieces have been separated and we could, in
185 # But at least now, all the pieces have been separated and we could, in
187 # principle, stop using the mixin. This will ease the transition to the
186 # principle, stop using the mixin. This will ease the transition to the
188 # chainsaw branch.
187 # chainsaw branch.
189
188
190 # For reference, the following is the list of 'self.foo' uses in the Magic
189 # For reference, the following is the list of 'self.foo' uses in the Magic
191 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
190 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
192 # class, to prevent clashes.
191 # class, to prevent clashes.
193
192
194 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
193 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
195 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
194 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
196 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
195 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
197 # 'self.value']
196 # 'self.value']
198
197
199 class InteractiveShell(object,Magic):
198 class InteractiveShell(object,Magic):
200 """An enhanced console for Python."""
199 """An enhanced console for Python."""
201
200
202 # class attribute to indicate whether the class supports threads or not.
201 # class attribute to indicate whether the class supports threads or not.
203 # Subclasses with thread support should override this as needed.
202 # Subclasses with thread support should override this as needed.
204 isthreaded = False
203 isthreaded = False
205
204
206 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
205 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
207 user_ns = None,user_global_ns=None,banner2='',
206 user_ns = None,user_global_ns=None,banner2='',
208 custom_exceptions=((),None),embedded=False):
207 custom_exceptions=((),None),embedded=False):
209
208
210 # log system
209 # log system
211 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
210 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
212
211
213 # some minimal strict typechecks. For some core data structures, I
212 # some minimal strict typechecks. For some core data structures, I
214 # want actual basic python types, not just anything that looks like
213 # want actual basic python types, not just anything that looks like
215 # one. This is especially true for namespaces.
214 # one. This is especially true for namespaces.
216 for ns in (user_ns,user_global_ns):
215 for ns in (user_ns,user_global_ns):
217 if ns is not None and type(ns) != types.DictType:
216 if ns is not None and type(ns) != types.DictType:
218 raise TypeError,'namespace must be a dictionary'
217 raise TypeError,'namespace must be a dictionary'
219
218
220 # Job manager (for jobs run as background threads)
219 # Job manager (for jobs run as background threads)
221 self.jobs = BackgroundJobManager()
220 self.jobs = BackgroundJobManager()
222
221
223 # Store the actual shell's name
222 # Store the actual shell's name
224 self.name = name
223 self.name = name
225
224
226 # We need to know whether the instance is meant for embedding, since
225 # We need to know whether the instance is meant for embedding, since
227 # global/local namespaces need to be handled differently in that case
226 # global/local namespaces need to be handled differently in that case
228 self.embedded = embedded
227 self.embedded = embedded
229
228
230 # command compiler
229 # command compiler
231 self.compile = codeop.CommandCompiler()
230 self.compile = codeop.CommandCompiler()
232
231
233 # User input buffer
232 # User input buffer
234 self.buffer = []
233 self.buffer = []
235
234
236 # Default name given in compilation of code
235 # Default name given in compilation of code
237 self.filename = '<ipython console>'
236 self.filename = '<ipython console>'
238
237
239 # Install our own quitter instead of the builtins. For python2.3-2.4,
238 # Install our own quitter instead of the builtins. For python2.3-2.4,
240 # this brings in behavior like 2.5, and for 2.5 it's identical.
239 # this brings in behavior like 2.5, and for 2.5 it's identical.
241 __builtin__.exit = Quitter(self,'exit')
240 __builtin__.exit = Quitter(self,'exit')
242 __builtin__.quit = Quitter(self,'quit')
241 __builtin__.quit = Quitter(self,'quit')
243
242
244 # Make an empty namespace, which extension writers can rely on both
243 # Make an empty namespace, which extension writers can rely on both
245 # existing and NEVER being used by ipython itself. This gives them a
244 # existing and NEVER being used by ipython itself. This gives them a
246 # convenient location for storing additional information and state
245 # convenient location for storing additional information and state
247 # their extensions may require, without fear of collisions with other
246 # their extensions may require, without fear of collisions with other
248 # ipython names that may develop later.
247 # ipython names that may develop later.
249 self.meta = Struct()
248 self.meta = Struct()
250
249
251 # Create the namespace where the user will operate. user_ns is
250 # Create the namespace where the user will operate. user_ns is
252 # normally the only one used, and it is passed to the exec calls as
251 # normally the only one used, and it is passed to the exec calls as
253 # the locals argument. But we do carry a user_global_ns namespace
252 # the locals argument. But we do carry a user_global_ns namespace
254 # given as the exec 'globals' argument, This is useful in embedding
253 # given as the exec 'globals' argument, This is useful in embedding
255 # situations where the ipython shell opens in a context where the
254 # situations where the ipython shell opens in a context where the
256 # distinction between locals and globals is meaningful.
255 # distinction between locals and globals is meaningful.
257
256
258 # FIXME. For some strange reason, __builtins__ is showing up at user
257 # FIXME. For some strange reason, __builtins__ is showing up at user
259 # level as a dict instead of a module. This is a manual fix, but I
258 # level as a dict instead of a module. This is a manual fix, but I
260 # should really track down where the problem is coming from. Alex
259 # should really track down where the problem is coming from. Alex
261 # Schmolck reported this problem first.
260 # Schmolck reported this problem first.
262
261
263 # A useful post by Alex Martelli on this topic:
262 # A useful post by Alex Martelli on this topic:
264 # Re: inconsistent value from __builtins__
263 # Re: inconsistent value from __builtins__
265 # Von: Alex Martelli <aleaxit@yahoo.com>
264 # Von: Alex Martelli <aleaxit@yahoo.com>
266 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
265 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
267 # Gruppen: comp.lang.python
266 # Gruppen: comp.lang.python
268
267
269 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
268 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
270 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
269 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
271 # > <type 'dict'>
270 # > <type 'dict'>
272 # > >>> print type(__builtins__)
271 # > >>> print type(__builtins__)
273 # > <type 'module'>
272 # > <type 'module'>
274 # > Is this difference in return value intentional?
273 # > Is this difference in return value intentional?
275
274
276 # Well, it's documented that '__builtins__' can be either a dictionary
275 # Well, it's documented that '__builtins__' can be either a dictionary
277 # or a module, and it's been that way for a long time. Whether it's
276 # or a module, and it's been that way for a long time. Whether it's
278 # intentional (or sensible), I don't know. In any case, the idea is
277 # intentional (or sensible), I don't know. In any case, the idea is
279 # that if you need to access the built-in namespace directly, you
278 # that if you need to access the built-in namespace directly, you
280 # should start with "import __builtin__" (note, no 's') which will
279 # should start with "import __builtin__" (note, no 's') which will
281 # definitely give you a module. Yeah, it's somewhat confusing:-(.
280 # definitely give you a module. Yeah, it's somewhat confusing:-(.
282
281
283 # These routines return properly built dicts as needed by the rest of
282 # These routines return properly built dicts as needed by the rest of
284 # the code, and can also be used by extension writers to generate
283 # the code, and can also be used by extension writers to generate
285 # properly initialized namespaces.
284 # properly initialized namespaces.
286 user_ns = IPython.ipapi.make_user_ns(user_ns)
285 user_ns = IPython.ipapi.make_user_ns(user_ns)
287 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
286 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
288
287
289 # Assign namespaces
288 # Assign namespaces
290 # This is the namespace where all normal user variables live
289 # This is the namespace where all normal user variables live
291 self.user_ns = user_ns
290 self.user_ns = user_ns
292 # Embedded instances require a separate namespace for globals.
291 # Embedded instances require a separate namespace for globals.
293 # Normally this one is unused by non-embedded instances.
292 # Normally this one is unused by non-embedded instances.
294 self.user_global_ns = user_global_ns
293 self.user_global_ns = user_global_ns
295 # A namespace to keep track of internal data structures to prevent
294 # A namespace to keep track of internal data structures to prevent
296 # them from cluttering user-visible stuff. Will be updated later
295 # them from cluttering user-visible stuff. Will be updated later
297 self.internal_ns = {}
296 self.internal_ns = {}
298
297
299 # Namespace of system aliases. Each entry in the alias
298 # Namespace of system aliases. Each entry in the alias
300 # table must be a 2-tuple of the form (N,name), where N is the number
299 # table must be a 2-tuple of the form (N,name), where N is the number
301 # of positional arguments of the alias.
300 # of positional arguments of the alias.
302 self.alias_table = {}
301 self.alias_table = {}
303
302
304 # A table holding all the namespaces IPython deals with, so that
303 # A table holding all the namespaces IPython deals with, so that
305 # introspection facilities can search easily.
304 # introspection facilities can search easily.
306 self.ns_table = {'user':user_ns,
305 self.ns_table = {'user':user_ns,
307 'user_global':user_global_ns,
306 'user_global':user_global_ns,
308 'alias':self.alias_table,
307 'alias':self.alias_table,
309 'internal':self.internal_ns,
308 'internal':self.internal_ns,
310 'builtin':__builtin__.__dict__
309 'builtin':__builtin__.__dict__
311 }
310 }
312
311
313 # The user namespace MUST have a pointer to the shell itself.
312 # The user namespace MUST have a pointer to the shell itself.
314 self.user_ns[name] = self
313 self.user_ns[name] = self
315
314
316 # We need to insert into sys.modules something that looks like a
315 # We need to insert into sys.modules something that looks like a
317 # module but which accesses the IPython namespace, for shelve and
316 # module but which accesses the IPython namespace, for shelve and
318 # pickle to work interactively. Normally they rely on getting
317 # pickle to work interactively. Normally they rely on getting
319 # everything out of __main__, but for embedding purposes each IPython
318 # everything out of __main__, but for embedding purposes each IPython
320 # instance has its own private namespace, so we can't go shoving
319 # instance has its own private namespace, so we can't go shoving
321 # everything into __main__.
320 # everything into __main__.
322
321
323 # note, however, that we should only do this for non-embedded
322 # note, however, that we should only do this for non-embedded
324 # ipythons, which really mimic the __main__.__dict__ with their own
323 # ipythons, which really mimic the __main__.__dict__ with their own
325 # namespace. Embedded instances, on the other hand, should not do
324 # namespace. Embedded instances, on the other hand, should not do
326 # this because they need to manage the user local/global namespaces
325 # this because they need to manage the user local/global namespaces
327 # only, but they live within a 'normal' __main__ (meaning, they
326 # only, but they live within a 'normal' __main__ (meaning, they
328 # shouldn't overtake the execution environment of the script they're
327 # shouldn't overtake the execution environment of the script they're
329 # embedded in).
328 # embedded in).
330
329
331 if not embedded:
330 if not embedded:
332 try:
331 try:
333 main_name = self.user_ns['__name__']
332 main_name = self.user_ns['__name__']
334 except KeyError:
333 except KeyError:
335 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
334 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
336 else:
335 else:
337 #print "pickle hack in place" # dbg
336 #print "pickle hack in place" # dbg
338 #print 'main_name:',main_name # dbg
337 #print 'main_name:',main_name # dbg
339 sys.modules[main_name] = FakeModule(self.user_ns)
338 sys.modules[main_name] = FakeModule(self.user_ns)
340
339
341 # List of input with multi-line handling.
340 # List of input with multi-line handling.
342 # Fill its zero entry, user counter starts at 1
341 # Fill its zero entry, user counter starts at 1
343 self.input_hist = InputList(['\n'])
342 self.input_hist = InputList(['\n'])
344 # This one will hold the 'raw' input history, without any
343 # This one will hold the 'raw' input history, without any
345 # pre-processing. This will allow users to retrieve the input just as
344 # pre-processing. This will allow users to retrieve the input just as
346 # it was exactly typed in by the user, with %hist -r.
345 # it was exactly typed in by the user, with %hist -r.
347 self.input_hist_raw = InputList(['\n'])
346 self.input_hist_raw = InputList(['\n'])
348
347
349 # list of visited directories
348 # list of visited directories
350 try:
349 try:
351 self.dir_hist = [os.getcwd()]
350 self.dir_hist = [os.getcwd()]
352 except IOError, e:
351 except IOError, e:
353 self.dir_hist = []
352 self.dir_hist = []
354
353
355 # dict of output history
354 # dict of output history
356 self.output_hist = {}
355 self.output_hist = {}
357
356
358 # dict of things NOT to alias (keywords, builtins and some magics)
357 # dict of things NOT to alias (keywords, builtins and some magics)
359 no_alias = {}
358 no_alias = {}
360 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
359 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
361 for key in keyword.kwlist + no_alias_magics:
360 for key in keyword.kwlist + no_alias_magics:
362 no_alias[key] = 1
361 no_alias[key] = 1
363 no_alias.update(__builtin__.__dict__)
362 no_alias.update(__builtin__.__dict__)
364 self.no_alias = no_alias
363 self.no_alias = no_alias
365
364
366 # make global variables for user access to these
365 # make global variables for user access to these
367 self.user_ns['_ih'] = self.input_hist
366 self.user_ns['_ih'] = self.input_hist
368 self.user_ns['_oh'] = self.output_hist
367 self.user_ns['_oh'] = self.output_hist
369 self.user_ns['_dh'] = self.dir_hist
368 self.user_ns['_dh'] = self.dir_hist
370
369
371 # user aliases to input and output histories
370 # user aliases to input and output histories
372 self.user_ns['In'] = self.input_hist
371 self.user_ns['In'] = self.input_hist
373 self.user_ns['Out'] = self.output_hist
372 self.user_ns['Out'] = self.output_hist
374
373
375 # Object variable to store code object waiting execution. This is
374 # Object variable to store code object waiting execution. This is
376 # used mainly by the multithreaded shells, but it can come in handy in
375 # used mainly by the multithreaded shells, but it can come in handy in
377 # other situations. No need to use a Queue here, since it's a single
376 # other situations. No need to use a Queue here, since it's a single
378 # item which gets cleared once run.
377 # item which gets cleared once run.
379 self.code_to_run = None
378 self.code_to_run = None
380
379
381 # escapes for automatic behavior on the command line
380 # escapes for automatic behavior on the command line
382 self.ESC_SHELL = '!'
381 self.ESC_SHELL = '!'
383 self.ESC_HELP = '?'
382 self.ESC_HELP = '?'
384 self.ESC_MAGIC = '%'
383 self.ESC_MAGIC = '%'
385 self.ESC_QUOTE = ','
384 self.ESC_QUOTE = ','
386 self.ESC_QUOTE2 = ';'
385 self.ESC_QUOTE2 = ';'
387 self.ESC_PAREN = '/'
386 self.ESC_PAREN = '/'
388
387
389 # And their associated handlers
388 # And their associated handlers
390 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
389 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
391 self.ESC_QUOTE : self.handle_auto,
390 self.ESC_QUOTE : self.handle_auto,
392 self.ESC_QUOTE2 : self.handle_auto,
391 self.ESC_QUOTE2 : self.handle_auto,
393 self.ESC_MAGIC : self.handle_magic,
392 self.ESC_MAGIC : self.handle_magic,
394 self.ESC_HELP : self.handle_help,
393 self.ESC_HELP : self.handle_help,
395 self.ESC_SHELL : self.handle_shell_escape,
394 self.ESC_SHELL : self.handle_shell_escape,
396 }
395 }
397
396
398 # class initializations
397 # class initializations
399 Magic.__init__(self,self)
398 Magic.__init__(self,self)
400
399
401 # Python source parser/formatter for syntax highlighting
400 # Python source parser/formatter for syntax highlighting
402 pyformat = PyColorize.Parser().format
401 pyformat = PyColorize.Parser().format
403 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
402 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
404
403
405 # hooks holds pointers used for user-side customizations
404 # hooks holds pointers used for user-side customizations
406 self.hooks = Struct()
405 self.hooks = Struct()
407
406
408 # Set all default hooks, defined in the IPython.hooks module.
407 # Set all default hooks, defined in the IPython.hooks module.
409 hooks = IPython.hooks
408 hooks = IPython.hooks
410 for hook_name in hooks.__all__:
409 for hook_name in hooks.__all__:
411 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
410 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
412 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
411 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
413 #print "bound hook",hook_name
412 #print "bound hook",hook_name
414
413
415 # Flag to mark unconditional exit
414 # Flag to mark unconditional exit
416 self.exit_now = False
415 self.exit_now = False
417
416
418 self.usage_min = """\
417 self.usage_min = """\
419 An enhanced console for Python.
418 An enhanced console for Python.
420 Some of its features are:
419 Some of its features are:
421 - Readline support if the readline library is present.
420 - Readline support if the readline library is present.
422 - Tab completion in the local namespace.
421 - Tab completion in the local namespace.
423 - Logging of input, see command-line options.
422 - Logging of input, see command-line options.
424 - System shell escape via ! , eg !ls.
423 - System shell escape via ! , eg !ls.
425 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
424 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
426 - Keeps track of locally defined variables via %who, %whos.
425 - Keeps track of locally defined variables via %who, %whos.
427 - Show object information with a ? eg ?x or x? (use ?? for more info).
426 - Show object information with a ? eg ?x or x? (use ?? for more info).
428 """
427 """
429 if usage: self.usage = usage
428 if usage: self.usage = usage
430 else: self.usage = self.usage_min
429 else: self.usage = self.usage_min
431
430
432 # Storage
431 # Storage
433 self.rc = rc # This will hold all configuration information
432 self.rc = rc # This will hold all configuration information
434 self.pager = 'less'
433 self.pager = 'less'
435 # temporary files used for various purposes. Deleted at exit.
434 # temporary files used for various purposes. Deleted at exit.
436 self.tempfiles = []
435 self.tempfiles = []
437
436
438 # Keep track of readline usage (later set by init_readline)
437 # Keep track of readline usage (later set by init_readline)
439 self.has_readline = False
438 self.has_readline = False
440
439
441 # template for logfile headers. It gets resolved at runtime by the
440 # template for logfile headers. It gets resolved at runtime by the
442 # logstart method.
441 # logstart method.
443 self.loghead_tpl = \
442 self.loghead_tpl = \
444 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
443 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
445 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
444 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
446 #log# opts = %s
445 #log# opts = %s
447 #log# args = %s
446 #log# args = %s
448 #log# It is safe to make manual edits below here.
447 #log# It is safe to make manual edits below here.
449 #log#-----------------------------------------------------------------------
448 #log#-----------------------------------------------------------------------
450 """
449 """
451 # for pushd/popd management
450 # for pushd/popd management
452 try:
451 try:
453 self.home_dir = get_home_dir()
452 self.home_dir = get_home_dir()
454 except HomeDirError,msg:
453 except HomeDirError,msg:
455 fatal(msg)
454 fatal(msg)
456
455
457 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
456 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
458
457
459 # Functions to call the underlying shell.
458 # Functions to call the underlying shell.
460
459
461 # utility to expand user variables via Itpl
460 # utility to expand user variables via Itpl
462 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
461 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
463 self.user_ns))
462 self.user_ns))
464 # The first is similar to os.system, but it doesn't return a value,
463 # The first is similar to os.system, but it doesn't return a value,
465 # and it allows interpolation of variables in the user's namespace.
464 # and it allows interpolation of variables in the user's namespace.
466 self.system = lambda cmd: shell(self.var_expand(cmd),
465 self.system = lambda cmd: shell(self.var_expand(cmd),
467 header='IPython system call: ',
466 header='IPython system call: ',
468 verbose=self.rc.system_verbose)
467 verbose=self.rc.system_verbose)
469 # These are for getoutput and getoutputerror:
468 # These are for getoutput and getoutputerror:
470 self.getoutput = lambda cmd: \
469 self.getoutput = lambda cmd: \
471 getoutput(self.var_expand(cmd),
470 getoutput(self.var_expand(cmd),
472 header='IPython system call: ',
471 header='IPython system call: ',
473 verbose=self.rc.system_verbose)
472 verbose=self.rc.system_verbose)
474 self.getoutputerror = lambda cmd: \
473 self.getoutputerror = lambda cmd: \
475 getoutputerror(self.var_expand(cmd),
474 getoutputerror(self.var_expand(cmd),
476 header='IPython system call: ',
475 header='IPython system call: ',
477 verbose=self.rc.system_verbose)
476 verbose=self.rc.system_verbose)
478
477
479 # RegExp for splitting line contents into pre-char//first
478 # RegExp for splitting line contents into pre-char//first
480 # word-method//rest. For clarity, each group in on one line.
479 # word-method//rest. For clarity, each group in on one line.
481
480
482 # WARNING: update the regexp if the above escapes are changed, as they
481 # WARNING: update the regexp if the above escapes are changed, as they
483 # are hardwired in.
482 # are hardwired in.
484
483
485 # Don't get carried away with trying to make the autocalling catch too
484 # Don't get carried away with trying to make the autocalling catch too
486 # much: it's better to be conservative rather than to trigger hidden
485 # much: it's better to be conservative rather than to trigger hidden
487 # evals() somewhere and end up causing side effects.
486 # evals() somewhere and end up causing side effects.
488
487
489 self.line_split = re.compile(r'^([\s*,;/])'
488 self.line_split = re.compile(r'^([\s*,;/])'
490 r'([\?\w\.]+\w*\s*)'
489 r'([\?\w\.]+\w*\s*)'
491 r'(\(?.*$)')
490 r'(\(?.*$)')
492
491
493 # Original re, keep around for a while in case changes break something
492 # Original re, keep around for a while in case changes break something
494 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
493 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
495 # r'(\s*[\?\w\.]+\w*\s*)'
494 # r'(\s*[\?\w\.]+\w*\s*)'
496 # r'(\(?.*$)')
495 # r'(\(?.*$)')
497
496
498 # RegExp to identify potential function names
497 # RegExp to identify potential function names
499 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
498 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
500
499
501 # RegExp to exclude strings with this start from autocalling. In
500 # RegExp to exclude strings with this start from autocalling. In
502 # particular, all binary operators should be excluded, so that if foo
501 # particular, all binary operators should be excluded, so that if foo
503 # is callable, foo OP bar doesn't become foo(OP bar), which is
502 # is callable, foo OP bar doesn't become foo(OP bar), which is
504 # invalid. The characters '!=()' don't need to be checked for, as the
503 # invalid. The characters '!=()' don't need to be checked for, as the
505 # _prefilter routine explicitely does so, to catch direct calls and
504 # _prefilter routine explicitely does so, to catch direct calls and
506 # rebindings of existing names.
505 # rebindings of existing names.
507
506
508 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
507 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
509 # it affects the rest of the group in square brackets.
508 # it affects the rest of the group in square brackets.
510 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
509 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
511 '|^is |^not |^in |^and |^or ')
510 '|^is |^not |^in |^and |^or ')
512
511
513 # try to catch also methods for stuff in lists/tuples/dicts: off
512 # try to catch also methods for stuff in lists/tuples/dicts: off
514 # (experimental). For this to work, the line_split regexp would need
513 # (experimental). For this to work, the line_split regexp would need
515 # to be modified so it wouldn't break things at '['. That line is
514 # to be modified so it wouldn't break things at '['. That line is
516 # nasty enough that I shouldn't change it until I can test it _well_.
515 # nasty enough that I shouldn't change it until I can test it _well_.
517 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
516 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
518
517
519 # keep track of where we started running (mainly for crash post-mortem)
518 # keep track of where we started running (mainly for crash post-mortem)
520 self.starting_dir = os.getcwd()
519 self.starting_dir = os.getcwd()
521
520
522 # Various switches which can be set
521 # Various switches which can be set
523 self.CACHELENGTH = 5000 # this is cheap, it's just text
522 self.CACHELENGTH = 5000 # this is cheap, it's just text
524 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
523 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
525 self.banner2 = banner2
524 self.banner2 = banner2
526
525
527 # TraceBack handlers:
526 # TraceBack handlers:
528
527
529 # Syntax error handler.
528 # Syntax error handler.
530 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
529 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
531
530
532 # The interactive one is initialized with an offset, meaning we always
531 # The interactive one is initialized with an offset, meaning we always
533 # want to remove the topmost item in the traceback, which is our own
532 # want to remove the topmost item in the traceback, which is our own
534 # internal code. Valid modes: ['Plain','Context','Verbose']
533 # internal code. Valid modes: ['Plain','Context','Verbose']
535 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
534 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
536 color_scheme='NoColor',
535 color_scheme='NoColor',
537 tb_offset = 1)
536 tb_offset = 1)
538
537
539 # IPython itself shouldn't crash. This will produce a detailed
538 # IPython itself shouldn't crash. This will produce a detailed
540 # post-mortem if it does. But we only install the crash handler for
539 # post-mortem if it does. But we only install the crash handler for
541 # non-threaded shells, the threaded ones use a normal verbose reporter
540 # non-threaded shells, the threaded ones use a normal verbose reporter
542 # and lose the crash handler. This is because exceptions in the main
541 # and lose the crash handler. This is because exceptions in the main
543 # thread (such as in GUI code) propagate directly to sys.excepthook,
542 # thread (such as in GUI code) propagate directly to sys.excepthook,
544 # and there's no point in printing crash dumps for every user exception.
543 # and there's no point in printing crash dumps for every user exception.
545 if self.isthreaded:
544 if self.isthreaded:
546 ipCrashHandler = ultraTB.FormattedTB()
545 ipCrashHandler = ultraTB.FormattedTB()
547 else:
546 else:
548 from IPython import CrashHandler
547 from IPython import CrashHandler
549 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
548 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
550 self.set_crash_handler(ipCrashHandler)
549 self.set_crash_handler(ipCrashHandler)
551
550
552 # and add any custom exception handlers the user may have specified
551 # and add any custom exception handlers the user may have specified
553 self.set_custom_exc(*custom_exceptions)
552 self.set_custom_exc(*custom_exceptions)
554
553
555 # indentation management
554 # indentation management
556 self.autoindent = False
555 self.autoindent = False
557 self.indent_current_nsp = 0
556 self.indent_current_nsp = 0
558
557
559 # Make some aliases automatically
558 # Make some aliases automatically
560 # Prepare list of shell aliases to auto-define
559 # Prepare list of shell aliases to auto-define
561 if os.name == 'posix':
560 if os.name == 'posix':
562 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
561 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
563 'mv mv -i','rm rm -i','cp cp -i',
562 'mv mv -i','rm rm -i','cp cp -i',
564 'cat cat','less less','clear clear',
563 'cat cat','less less','clear clear',
565 # a better ls
564 # a better ls
566 'ls ls -F',
565 'ls ls -F',
567 # long ls
566 # long ls
568 'll ls -lF')
567 'll ls -lF')
569 # Extra ls aliases with color, which need special treatment on BSD
568 # Extra ls aliases with color, which need special treatment on BSD
570 # variants
569 # variants
571 ls_extra = ( # color ls
570 ls_extra = ( # color ls
572 'lc ls -F -o --color',
571 'lc ls -F -o --color',
573 # ls normal files only
572 # ls normal files only
574 'lf ls -F -o --color %l | grep ^-',
573 'lf ls -F -o --color %l | grep ^-',
575 # ls symbolic links
574 # ls symbolic links
576 'lk ls -F -o --color %l | grep ^l',
575 'lk ls -F -o --color %l | grep ^l',
577 # directories or links to directories,
576 # directories or links to directories,
578 'ldir ls -F -o --color %l | grep /$',
577 'ldir ls -F -o --color %l | grep /$',
579 # things which are executable
578 # things which are executable
580 'lx ls -F -o --color %l | grep ^-..x',
579 'lx ls -F -o --color %l | grep ^-..x',
581 )
580 )
582 # The BSDs don't ship GNU ls, so they don't understand the
581 # The BSDs don't ship GNU ls, so they don't understand the
583 # --color switch out of the box
582 # --color switch out of the box
584 if 'bsd' in sys.platform:
583 if 'bsd' in sys.platform:
585 ls_extra = ( # ls normal files only
584 ls_extra = ( # ls normal files only
586 'lf ls -lF | grep ^-',
585 'lf ls -lF | grep ^-',
587 # ls symbolic links
586 # ls symbolic links
588 'lk ls -lF | grep ^l',
587 'lk ls -lF | grep ^l',
589 # directories or links to directories,
588 # directories or links to directories,
590 'ldir ls -lF | grep /$',
589 'ldir ls -lF | grep /$',
591 # things which are executable
590 # things which are executable
592 'lx ls -lF | grep ^-..x',
591 'lx ls -lF | grep ^-..x',
593 )
592 )
594 auto_alias = auto_alias + ls_extra
593 auto_alias = auto_alias + ls_extra
595 elif os.name in ['nt','dos']:
594 elif os.name in ['nt','dos']:
596 auto_alias = ('dir dir /on', 'ls dir /on',
595 auto_alias = ('dir dir /on', 'ls dir /on',
597 'ddir dir /ad /on', 'ldir dir /ad /on',
596 'ddir dir /ad /on', 'ldir dir /ad /on',
598 'mkdir mkdir','rmdir rmdir','echo echo',
597 'mkdir mkdir','rmdir rmdir','echo echo',
599 'ren ren','cls cls','copy copy')
598 'ren ren','cls cls','copy copy')
600 else:
599 else:
601 auto_alias = ()
600 auto_alias = ()
602 self.auto_alias = [s.split(None,1) for s in auto_alias]
601 self.auto_alias = [s.split(None,1) for s in auto_alias]
603 # Call the actual (public) initializer
602 # Call the actual (public) initializer
604 self.init_auto_alias()
603 self.init_auto_alias()
605
604
606 # Produce a public API instance
605 # Produce a public API instance
607 self.api = IPython.ipapi.IPApi(self)
606 self.api = IPython.ipapi.IPApi(self)
608
607
609 # track which builtins we add, so we can clean up later
608 # track which builtins we add, so we can clean up later
610 self.builtins_added = {}
609 self.builtins_added = {}
611 # This method will add the necessary builtins for operation, but
610 # This method will add the necessary builtins for operation, but
612 # tracking what it did via the builtins_added dict.
611 # tracking what it did via the builtins_added dict.
613 self.add_builtins()
612 self.add_builtins()
614
613
615 # end __init__
614 # end __init__
616
615
617 def pre_config_initialization(self):
616 def pre_config_initialization(self):
618 """Pre-configuration init method
617 """Pre-configuration init method
619
618
620 This is called before the configuration files are processed to
619 This is called before the configuration files are processed to
621 prepare the services the config files might need.
620 prepare the services the config files might need.
622
621
623 self.rc already has reasonable default values at this point.
622 self.rc already has reasonable default values at this point.
624 """
623 """
625 rc = self.rc
624 rc = self.rc
626
625
627 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
626 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
628
627
629 def post_config_initialization(self):
628 def post_config_initialization(self):
630 """Post configuration init method
629 """Post configuration init method
631
630
632 This is called after the configuration files have been processed to
631 This is called after the configuration files have been processed to
633 'finalize' the initialization."""
632 'finalize' the initialization."""
634
633
635 rc = self.rc
634 rc = self.rc
636
635
637 # Object inspector
636 # Object inspector
638 self.inspector = OInspect.Inspector(OInspect.InspectColors,
637 self.inspector = OInspect.Inspector(OInspect.InspectColors,
639 PyColorize.ANSICodeColors,
638 PyColorize.ANSICodeColors,
640 'NoColor',
639 'NoColor',
641 rc.object_info_string_level)
640 rc.object_info_string_level)
642
641
643 # Load readline proper
642 # Load readline proper
644 if rc.readline:
643 if rc.readline:
645 self.init_readline()
644 self.init_readline()
646
645
647 # local shortcut, this is used a LOT
646 # local shortcut, this is used a LOT
648 self.log = self.logger.log
647 self.log = self.logger.log
649
648
650 # Initialize cache, set in/out prompts and printing system
649 # Initialize cache, set in/out prompts and printing system
651 self.outputcache = CachedOutput(self,
650 self.outputcache = CachedOutput(self,
652 rc.cache_size,
651 rc.cache_size,
653 rc.pprint,
652 rc.pprint,
654 input_sep = rc.separate_in,
653 input_sep = rc.separate_in,
655 output_sep = rc.separate_out,
654 output_sep = rc.separate_out,
656 output_sep2 = rc.separate_out2,
655 output_sep2 = rc.separate_out2,
657 ps1 = rc.prompt_in1,
656 ps1 = rc.prompt_in1,
658 ps2 = rc.prompt_in2,
657 ps2 = rc.prompt_in2,
659 ps_out = rc.prompt_out,
658 ps_out = rc.prompt_out,
660 pad_left = rc.prompts_pad_left)
659 pad_left = rc.prompts_pad_left)
661
660
662 # user may have over-ridden the default print hook:
661 # user may have over-ridden the default print hook:
663 try:
662 try:
664 self.outputcache.__class__.display = self.hooks.display
663 self.outputcache.__class__.display = self.hooks.display
665 except AttributeError:
664 except AttributeError:
666 pass
665 pass
667
666
668 # I don't like assigning globally to sys, because it means when
667 # I don't like assigning globally to sys, because it means when
669 # embedding instances, each embedded instance overrides the previous
668 # embedding instances, each embedded instance overrides the previous
670 # choice. But sys.displayhook seems to be called internally by exec,
669 # choice. But sys.displayhook seems to be called internally by exec,
671 # so I don't see a way around it. We first save the original and then
670 # so I don't see a way around it. We first save the original and then
672 # overwrite it.
671 # overwrite it.
673 self.sys_displayhook = sys.displayhook
672 self.sys_displayhook = sys.displayhook
674 sys.displayhook = self.outputcache
673 sys.displayhook = self.outputcache
675
674
676 # Set user colors (don't do it in the constructor above so that it
675 # Set user colors (don't do it in the constructor above so that it
677 # doesn't crash if colors option is invalid)
676 # doesn't crash if colors option is invalid)
678 self.magic_colors(rc.colors)
677 self.magic_colors(rc.colors)
679
678
680 # Set calling of pdb on exceptions
679 # Set calling of pdb on exceptions
681 self.call_pdb = rc.pdb
680 self.call_pdb = rc.pdb
682
681
683 # Load user aliases
682 # Load user aliases
684 for alias in rc.alias:
683 for alias in rc.alias:
685 self.magic_alias(alias)
684 self.magic_alias(alias)
686 self.hooks.late_startup_hook()
685 self.hooks.late_startup_hook()
687
686
688 batchrun = False
687 batchrun = False
689 for batchfile in [path(arg) for arg in self.rc.args
688 for batchfile in [path(arg) for arg in self.rc.args
690 if arg.lower().endswith('.ipy')]:
689 if arg.lower().endswith('.ipy')]:
691 if not batchfile.isfile():
690 if not batchfile.isfile():
692 print "No such batch file:", batchfile
691 print "No such batch file:", batchfile
693 continue
692 continue
694 self.api.runlines(batchfile.text())
693 self.api.runlines(batchfile.text())
695 batchrun = True
694 batchrun = True
696 if batchrun:
695 if batchrun:
697 self.exit_now = True
696 self.exit_now = True
698
697
699 def add_builtins(self):
698 def add_builtins(self):
700 """Store ipython references into the builtin namespace.
699 """Store ipython references into the builtin namespace.
701
700
702 Some parts of ipython operate via builtins injected here, which hold a
701 Some parts of ipython operate via builtins injected here, which hold a
703 reference to IPython itself."""
702 reference to IPython itself."""
704
703
705 # TODO: deprecate all except _ip; 'jobs' should be installed
704 # TODO: deprecate all except _ip; 'jobs' should be installed
706 # by an extension and the rest are under _ip, ipalias is redundant
705 # by an extension and the rest are under _ip, ipalias is redundant
707 builtins_new = dict(__IPYTHON__ = self,
706 builtins_new = dict(__IPYTHON__ = self,
708 ip_set_hook = self.set_hook,
707 ip_set_hook = self.set_hook,
709 jobs = self.jobs,
708 jobs = self.jobs,
710 ipmagic = self.ipmagic,
709 ipmagic = self.ipmagic,
711 ipalias = self.ipalias,
710 ipalias = self.ipalias,
712 ipsystem = self.ipsystem,
711 ipsystem = self.ipsystem,
713 _ip = self.api
712 _ip = self.api
714 )
713 )
715 for biname,bival in builtins_new.items():
714 for biname,bival in builtins_new.items():
716 try:
715 try:
717 # store the orignal value so we can restore it
716 # store the orignal value so we can restore it
718 self.builtins_added[biname] = __builtin__.__dict__[biname]
717 self.builtins_added[biname] = __builtin__.__dict__[biname]
719 except KeyError:
718 except KeyError:
720 # or mark that it wasn't defined, and we'll just delete it at
719 # or mark that it wasn't defined, and we'll just delete it at
721 # cleanup
720 # cleanup
722 self.builtins_added[biname] = Undefined
721 self.builtins_added[biname] = Undefined
723 __builtin__.__dict__[biname] = bival
722 __builtin__.__dict__[biname] = bival
724
723
725 # Keep in the builtins a flag for when IPython is active. We set it
724 # Keep in the builtins a flag for when IPython is active. We set it
726 # with setdefault so that multiple nested IPythons don't clobber one
725 # with setdefault so that multiple nested IPythons don't clobber one
727 # another. Each will increase its value by one upon being activated,
726 # another. Each will increase its value by one upon being activated,
728 # which also gives us a way to determine the nesting level.
727 # which also gives us a way to determine the nesting level.
729 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
728 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
730
729
731 def clean_builtins(self):
730 def clean_builtins(self):
732 """Remove any builtins which might have been added by add_builtins, or
731 """Remove any builtins which might have been added by add_builtins, or
733 restore overwritten ones to their previous values."""
732 restore overwritten ones to their previous values."""
734 for biname,bival in self.builtins_added.items():
733 for biname,bival in self.builtins_added.items():
735 if bival is Undefined:
734 if bival is Undefined:
736 del __builtin__.__dict__[biname]
735 del __builtin__.__dict__[biname]
737 else:
736 else:
738 __builtin__.__dict__[biname] = bival
737 __builtin__.__dict__[biname] = bival
739 self.builtins_added.clear()
738 self.builtins_added.clear()
740
739
741 def set_hook(self,name,hook, priority = 50):
740 def set_hook(self,name,hook, priority = 50):
742 """set_hook(name,hook) -> sets an internal IPython hook.
741 """set_hook(name,hook) -> sets an internal IPython hook.
743
742
744 IPython exposes some of its internal API as user-modifiable hooks. By
743 IPython exposes some of its internal API as user-modifiable hooks. By
745 adding your function to one of these hooks, you can modify IPython's
744 adding your function to one of these hooks, you can modify IPython's
746 behavior to call at runtime your own routines."""
745 behavior to call at runtime your own routines."""
747
746
748 # At some point in the future, this should validate the hook before it
747 # At some point in the future, this should validate the hook before it
749 # accepts it. Probably at least check that the hook takes the number
748 # accepts it. Probably at least check that the hook takes the number
750 # of args it's supposed to.
749 # of args it's supposed to.
751 dp = getattr(self.hooks, name, None)
750 dp = getattr(self.hooks, name, None)
752 if name not in IPython.hooks.__all__:
751 if name not in IPython.hooks.__all__:
753 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
752 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
754 if not dp:
753 if not dp:
755 dp = IPython.hooks.CommandChainDispatcher()
754 dp = IPython.hooks.CommandChainDispatcher()
756
755
757 f = new.instancemethod(hook,self,self.__class__)
756 f = new.instancemethod(hook,self,self.__class__)
758 try:
757 try:
759 dp.add(f,priority)
758 dp.add(f,priority)
760 except AttributeError:
759 except AttributeError:
761 # it was not commandchain, plain old func - replace
760 # it was not commandchain, plain old func - replace
762 dp = f
761 dp = f
763
762
764 setattr(self.hooks,name, dp)
763 setattr(self.hooks,name, dp)
765
764
766
765
767 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
766 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
768
767
769 def set_crash_handler(self,crashHandler):
768 def set_crash_handler(self,crashHandler):
770 """Set the IPython crash handler.
769 """Set the IPython crash handler.
771
770
772 This must be a callable with a signature suitable for use as
771 This must be a callable with a signature suitable for use as
773 sys.excepthook."""
772 sys.excepthook."""
774
773
775 # Install the given crash handler as the Python exception hook
774 # Install the given crash handler as the Python exception hook
776 sys.excepthook = crashHandler
775 sys.excepthook = crashHandler
777
776
778 # The instance will store a pointer to this, so that runtime code
777 # The instance will store a pointer to this, so that runtime code
779 # (such as magics) can access it. This is because during the
778 # (such as magics) can access it. This is because during the
780 # read-eval loop, it gets temporarily overwritten (to deal with GUI
779 # read-eval loop, it gets temporarily overwritten (to deal with GUI
781 # frameworks).
780 # frameworks).
782 self.sys_excepthook = sys.excepthook
781 self.sys_excepthook = sys.excepthook
783
782
784
783
785 def set_custom_exc(self,exc_tuple,handler):
784 def set_custom_exc(self,exc_tuple,handler):
786 """set_custom_exc(exc_tuple,handler)
785 """set_custom_exc(exc_tuple,handler)
787
786
788 Set a custom exception handler, which will be called if any of the
787 Set a custom exception handler, which will be called if any of the
789 exceptions in exc_tuple occur in the mainloop (specifically, in the
788 exceptions in exc_tuple occur in the mainloop (specifically, in the
790 runcode() method.
789 runcode() method.
791
790
792 Inputs:
791 Inputs:
793
792
794 - exc_tuple: a *tuple* of valid exceptions to call the defined
793 - exc_tuple: a *tuple* of valid exceptions to call the defined
795 handler for. It is very important that you use a tuple, and NOT A
794 handler for. It is very important that you use a tuple, and NOT A
796 LIST here, because of the way Python's except statement works. If
795 LIST here, because of the way Python's except statement works. If
797 you only want to trap a single exception, use a singleton tuple:
796 you only want to trap a single exception, use a singleton tuple:
798
797
799 exc_tuple == (MyCustomException,)
798 exc_tuple == (MyCustomException,)
800
799
801 - handler: this must be defined as a function with the following
800 - handler: this must be defined as a function with the following
802 basic interface: def my_handler(self,etype,value,tb).
801 basic interface: def my_handler(self,etype,value,tb).
803
802
804 This will be made into an instance method (via new.instancemethod)
803 This will be made into an instance method (via new.instancemethod)
805 of IPython itself, and it will be called if any of the exceptions
804 of IPython itself, and it will be called if any of the exceptions
806 listed in the exc_tuple are caught. If the handler is None, an
805 listed in the exc_tuple are caught. If the handler is None, an
807 internal basic one is used, which just prints basic info.
806 internal basic one is used, which just prints basic info.
808
807
809 WARNING: by putting in your own exception handler into IPython's main
808 WARNING: by putting in your own exception handler into IPython's main
810 execution loop, you run a very good chance of nasty crashes. This
809 execution loop, you run a very good chance of nasty crashes. This
811 facility should only be used if you really know what you are doing."""
810 facility should only be used if you really know what you are doing."""
812
811
813 assert type(exc_tuple)==type(()) , \
812 assert type(exc_tuple)==type(()) , \
814 "The custom exceptions must be given AS A TUPLE."
813 "The custom exceptions must be given AS A TUPLE."
815
814
816 def dummy_handler(self,etype,value,tb):
815 def dummy_handler(self,etype,value,tb):
817 print '*** Simple custom exception handler ***'
816 print '*** Simple custom exception handler ***'
818 print 'Exception type :',etype
817 print 'Exception type :',etype
819 print 'Exception value:',value
818 print 'Exception value:',value
820 print 'Traceback :',tb
819 print 'Traceback :',tb
821 print 'Source code :','\n'.join(self.buffer)
820 print 'Source code :','\n'.join(self.buffer)
822
821
823 if handler is None: handler = dummy_handler
822 if handler is None: handler = dummy_handler
824
823
825 self.CustomTB = new.instancemethod(handler,self,self.__class__)
824 self.CustomTB = new.instancemethod(handler,self,self.__class__)
826 self.custom_exceptions = exc_tuple
825 self.custom_exceptions = exc_tuple
827
826
828 def set_custom_completer(self,completer,pos=0):
827 def set_custom_completer(self,completer,pos=0):
829 """set_custom_completer(completer,pos=0)
828 """set_custom_completer(completer,pos=0)
830
829
831 Adds a new custom completer function.
830 Adds a new custom completer function.
832
831
833 The position argument (defaults to 0) is the index in the completers
832 The position argument (defaults to 0) is the index in the completers
834 list where you want the completer to be inserted."""
833 list where you want the completer to be inserted."""
835
834
836 newcomp = new.instancemethod(completer,self.Completer,
835 newcomp = new.instancemethod(completer,self.Completer,
837 self.Completer.__class__)
836 self.Completer.__class__)
838 self.Completer.matchers.insert(pos,newcomp)
837 self.Completer.matchers.insert(pos,newcomp)
839
838
840 def _get_call_pdb(self):
839 def _get_call_pdb(self):
841 return self._call_pdb
840 return self._call_pdb
842
841
843 def _set_call_pdb(self,val):
842 def _set_call_pdb(self,val):
844
843
845 if val not in (0,1,False,True):
844 if val not in (0,1,False,True):
846 raise ValueError,'new call_pdb value must be boolean'
845 raise ValueError,'new call_pdb value must be boolean'
847
846
848 # store value in instance
847 # store value in instance
849 self._call_pdb = val
848 self._call_pdb = val
850
849
851 # notify the actual exception handlers
850 # notify the actual exception handlers
852 self.InteractiveTB.call_pdb = val
851 self.InteractiveTB.call_pdb = val
853 if self.isthreaded:
852 if self.isthreaded:
854 try:
853 try:
855 self.sys_excepthook.call_pdb = val
854 self.sys_excepthook.call_pdb = val
856 except:
855 except:
857 warn('Failed to activate pdb for threaded exception handler')
856 warn('Failed to activate pdb for threaded exception handler')
858
857
859 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
858 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
860 'Control auto-activation of pdb at exceptions')
859 'Control auto-activation of pdb at exceptions')
861
860
862
861
863 # These special functions get installed in the builtin namespace, to
862 # These special functions get installed in the builtin namespace, to
864 # provide programmatic (pure python) access to magics, aliases and system
863 # provide programmatic (pure python) access to magics, aliases and system
865 # calls. This is important for logging, user scripting, and more.
864 # calls. This is important for logging, user scripting, and more.
866
865
867 # We are basically exposing, via normal python functions, the three
866 # We are basically exposing, via normal python functions, the three
868 # mechanisms in which ipython offers special call modes (magics for
867 # mechanisms in which ipython offers special call modes (magics for
869 # internal control, aliases for direct system access via pre-selected
868 # internal control, aliases for direct system access via pre-selected
870 # names, and !cmd for calling arbitrary system commands).
869 # names, and !cmd for calling arbitrary system commands).
871
870
872 def ipmagic(self,arg_s):
871 def ipmagic(self,arg_s):
873 """Call a magic function by name.
872 """Call a magic function by name.
874
873
875 Input: a string containing the name of the magic function to call and any
874 Input: a string containing the name of the magic function to call and any
876 additional arguments to be passed to the magic.
875 additional arguments to be passed to the magic.
877
876
878 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
877 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
879 prompt:
878 prompt:
880
879
881 In[1]: %name -opt foo bar
880 In[1]: %name -opt foo bar
882
881
883 To call a magic without arguments, simply use ipmagic('name').
882 To call a magic without arguments, simply use ipmagic('name').
884
883
885 This provides a proper Python function to call IPython's magics in any
884 This provides a proper Python function to call IPython's magics in any
886 valid Python code you can type at the interpreter, including loops and
885 valid Python code you can type at the interpreter, including loops and
887 compound statements. It is added by IPython to the Python builtin
886 compound statements. It is added by IPython to the Python builtin
888 namespace upon initialization."""
887 namespace upon initialization."""
889
888
890 args = arg_s.split(' ',1)
889 args = arg_s.split(' ',1)
891 magic_name = args[0]
890 magic_name = args[0]
892 magic_name = magic_name.lstrip(self.ESC_MAGIC)
891 magic_name = magic_name.lstrip(self.ESC_MAGIC)
893
892
894 try:
893 try:
895 magic_args = args[1]
894 magic_args = args[1]
896 except IndexError:
895 except IndexError:
897 magic_args = ''
896 magic_args = ''
898 fn = getattr(self,'magic_'+magic_name,None)
897 fn = getattr(self,'magic_'+magic_name,None)
899 if fn is None:
898 if fn is None:
900 error("Magic function `%s` not found." % magic_name)
899 error("Magic function `%s` not found." % magic_name)
901 else:
900 else:
902 magic_args = self.var_expand(magic_args)
901 magic_args = self.var_expand(magic_args)
903 return fn(magic_args)
902 return fn(magic_args)
904
903
905 def ipalias(self,arg_s):
904 def ipalias(self,arg_s):
906 """Call an alias by name.
905 """Call an alias by name.
907
906
908 Input: a string containing the name of the alias to call and any
907 Input: a string containing the name of the alias to call and any
909 additional arguments to be passed to the magic.
908 additional arguments to be passed to the magic.
910
909
911 ipalias('name -opt foo bar') is equivalent to typing at the ipython
910 ipalias('name -opt foo bar') is equivalent to typing at the ipython
912 prompt:
911 prompt:
913
912
914 In[1]: name -opt foo bar
913 In[1]: name -opt foo bar
915
914
916 To call an alias without arguments, simply use ipalias('name').
915 To call an alias without arguments, simply use ipalias('name').
917
916
918 This provides a proper Python function to call IPython's aliases in any
917 This provides a proper Python function to call IPython's aliases in any
919 valid Python code you can type at the interpreter, including loops and
918 valid Python code you can type at the interpreter, including loops and
920 compound statements. It is added by IPython to the Python builtin
919 compound statements. It is added by IPython to the Python builtin
921 namespace upon initialization."""
920 namespace upon initialization."""
922
921
923 args = arg_s.split(' ',1)
922 args = arg_s.split(' ',1)
924 alias_name = args[0]
923 alias_name = args[0]
925 try:
924 try:
926 alias_args = args[1]
925 alias_args = args[1]
927 except IndexError:
926 except IndexError:
928 alias_args = ''
927 alias_args = ''
929 if alias_name in self.alias_table:
928 if alias_name in self.alias_table:
930 self.call_alias(alias_name,alias_args)
929 self.call_alias(alias_name,alias_args)
931 else:
930 else:
932 error("Alias `%s` not found." % alias_name)
931 error("Alias `%s` not found." % alias_name)
933
932
934 def ipsystem(self,arg_s):
933 def ipsystem(self,arg_s):
935 """Make a system call, using IPython."""
934 """Make a system call, using IPython."""
936
935
937 self.system(arg_s)
936 self.system(arg_s)
938
937
939 def complete(self,text):
938 def complete(self,text):
940 """Return a sorted list of all possible completions on text.
939 """Return a sorted list of all possible completions on text.
941
940
942 Inputs:
941 Inputs:
943
942
944 - text: a string of text to be completed on.
943 - text: a string of text to be completed on.
945
944
946 This is a wrapper around the completion mechanism, similar to what
945 This is a wrapper around the completion mechanism, similar to what
947 readline does at the command line when the TAB key is hit. By
946 readline does at the command line when the TAB key is hit. By
948 exposing it as a method, it can be used by other non-readline
947 exposing it as a method, it can be used by other non-readline
949 environments (such as GUIs) for text completion.
948 environments (such as GUIs) for text completion.
950
949
951 Simple usage example:
950 Simple usage example:
952
951
953 In [1]: x = 'hello'
952 In [1]: x = 'hello'
954
953
955 In [2]: __IP.complete('x.l')
954 In [2]: __IP.complete('x.l')
956 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
955 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
957
956
958 complete = self.Completer.complete
957 complete = self.Completer.complete
959 state = 0
958 state = 0
960 # use a dict so we get unique keys, since ipyhton's multiple
959 # use a dict so we get unique keys, since ipyhton's multiple
961 # completers can return duplicates.
960 # completers can return duplicates.
962 comps = {}
961 comps = {}
963 while True:
962 while True:
964 newcomp = complete(text,state)
963 newcomp = complete(text,state)
965 if newcomp is None:
964 if newcomp is None:
966 break
965 break
967 comps[newcomp] = 1
966 comps[newcomp] = 1
968 state += 1
967 state += 1
969 outcomps = comps.keys()
968 outcomps = comps.keys()
970 outcomps.sort()
969 outcomps.sort()
971 return outcomps
970 return outcomps
972
971
973 def set_completer_frame(self, frame=None):
972 def set_completer_frame(self, frame=None):
974 if frame:
973 if frame:
975 self.Completer.namespace = frame.f_locals
974 self.Completer.namespace = frame.f_locals
976 self.Completer.global_namespace = frame.f_globals
975 self.Completer.global_namespace = frame.f_globals
977 else:
976 else:
978 self.Completer.namespace = self.user_ns
977 self.Completer.namespace = self.user_ns
979 self.Completer.global_namespace = self.user_global_ns
978 self.Completer.global_namespace = self.user_global_ns
980
979
981 def init_auto_alias(self):
980 def init_auto_alias(self):
982 """Define some aliases automatically.
981 """Define some aliases automatically.
983
982
984 These are ALL parameter-less aliases"""
983 These are ALL parameter-less aliases"""
985
984
986 for alias,cmd in self.auto_alias:
985 for alias,cmd in self.auto_alias:
987 self.alias_table[alias] = (0,cmd)
986 self.alias_table[alias] = (0,cmd)
988
987
989 def alias_table_validate(self,verbose=0):
988 def alias_table_validate(self,verbose=0):
990 """Update information about the alias table.
989 """Update information about the alias table.
991
990
992 In particular, make sure no Python keywords/builtins are in it."""
991 In particular, make sure no Python keywords/builtins are in it."""
993
992
994 no_alias = self.no_alias
993 no_alias = self.no_alias
995 for k in self.alias_table.keys():
994 for k in self.alias_table.keys():
996 if k in no_alias:
995 if k in no_alias:
997 del self.alias_table[k]
996 del self.alias_table[k]
998 if verbose:
997 if verbose:
999 print ("Deleting alias <%s>, it's a Python "
998 print ("Deleting alias <%s>, it's a Python "
1000 "keyword or builtin." % k)
999 "keyword or builtin." % k)
1001
1000
1002 def set_autoindent(self,value=None):
1001 def set_autoindent(self,value=None):
1003 """Set the autoindent flag, checking for readline support.
1002 """Set the autoindent flag, checking for readline support.
1004
1003
1005 If called with no arguments, it acts as a toggle."""
1004 If called with no arguments, it acts as a toggle."""
1006
1005
1007 if not self.has_readline:
1006 if not self.has_readline:
1008 if os.name == 'posix':
1007 if os.name == 'posix':
1009 warn("The auto-indent feature requires the readline library")
1008 warn("The auto-indent feature requires the readline library")
1010 self.autoindent = 0
1009 self.autoindent = 0
1011 return
1010 return
1012 if value is None:
1011 if value is None:
1013 self.autoindent = not self.autoindent
1012 self.autoindent = not self.autoindent
1014 else:
1013 else:
1015 self.autoindent = value
1014 self.autoindent = value
1016
1015
1017 def rc_set_toggle(self,rc_field,value=None):
1016 def rc_set_toggle(self,rc_field,value=None):
1018 """Set or toggle a field in IPython's rc config. structure.
1017 """Set or toggle a field in IPython's rc config. structure.
1019
1018
1020 If called with no arguments, it acts as a toggle.
1019 If called with no arguments, it acts as a toggle.
1021
1020
1022 If called with a non-existent field, the resulting AttributeError
1021 If called with a non-existent field, the resulting AttributeError
1023 exception will propagate out."""
1022 exception will propagate out."""
1024
1023
1025 rc_val = getattr(self.rc,rc_field)
1024 rc_val = getattr(self.rc,rc_field)
1026 if value is None:
1025 if value is None:
1027 value = not rc_val
1026 value = not rc_val
1028 setattr(self.rc,rc_field,value)
1027 setattr(self.rc,rc_field,value)
1029
1028
1030 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1029 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1031 """Install the user configuration directory.
1030 """Install the user configuration directory.
1032
1031
1033 Can be called when running for the first time or to upgrade the user's
1032 Can be called when running for the first time or to upgrade the user's
1034 .ipython/ directory with the mode parameter. Valid modes are 'install'
1033 .ipython/ directory with the mode parameter. Valid modes are 'install'
1035 and 'upgrade'."""
1034 and 'upgrade'."""
1036
1035
1037 def wait():
1036 def wait():
1038 try:
1037 try:
1039 raw_input("Please press <RETURN> to start IPython.")
1038 raw_input("Please press <RETURN> to start IPython.")
1040 except EOFError:
1039 except EOFError:
1041 print >> Term.cout
1040 print >> Term.cout
1042 print '*'*70
1041 print '*'*70
1043
1042
1044 cwd = os.getcwd() # remember where we started
1043 cwd = os.getcwd() # remember where we started
1045 glb = glob.glob
1044 glb = glob.glob
1046 print '*'*70
1045 print '*'*70
1047 if mode == 'install':
1046 if mode == 'install':
1048 print \
1047 print \
1049 """Welcome to IPython. I will try to create a personal configuration directory
1048 """Welcome to IPython. I will try to create a personal configuration directory
1050 where you can customize many aspects of IPython's functionality in:\n"""
1049 where you can customize many aspects of IPython's functionality in:\n"""
1051 else:
1050 else:
1052 print 'I am going to upgrade your configuration in:'
1051 print 'I am going to upgrade your configuration in:'
1053
1052
1054 print ipythondir
1053 print ipythondir
1055
1054
1056 rcdirend = os.path.join('IPython','UserConfig')
1055 rcdirend = os.path.join('IPython','UserConfig')
1057 cfg = lambda d: os.path.join(d,rcdirend)
1056 cfg = lambda d: os.path.join(d,rcdirend)
1058 try:
1057 try:
1059 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1058 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1060 except IOError:
1059 except IOError:
1061 warning = """
1060 warning = """
1062 Installation error. IPython's directory was not found.
1061 Installation error. IPython's directory was not found.
1063
1062
1064 Check the following:
1063 Check the following:
1065
1064
1066 The ipython/IPython directory should be in a directory belonging to your
1065 The ipython/IPython directory should be in a directory belonging to your
1067 PYTHONPATH environment variable (that is, it should be in a directory
1066 PYTHONPATH environment variable (that is, it should be in a directory
1068 belonging to sys.path). You can copy it explicitly there or just link to it.
1067 belonging to sys.path). You can copy it explicitly there or just link to it.
1069
1068
1070 IPython will proceed with builtin defaults.
1069 IPython will proceed with builtin defaults.
1071 """
1070 """
1072 warn(warning)
1071 warn(warning)
1073 wait()
1072 wait()
1074 return
1073 return
1075
1074
1076 if mode == 'install':
1075 if mode == 'install':
1077 try:
1076 try:
1078 shutil.copytree(rcdir,ipythondir)
1077 shutil.copytree(rcdir,ipythondir)
1079 os.chdir(ipythondir)
1078 os.chdir(ipythondir)
1080 rc_files = glb("ipythonrc*")
1079 rc_files = glb("ipythonrc*")
1081 for rc_file in rc_files:
1080 for rc_file in rc_files:
1082 os.rename(rc_file,rc_file+rc_suffix)
1081 os.rename(rc_file,rc_file+rc_suffix)
1083 except:
1082 except:
1084 warning = """
1083 warning = """
1085
1084
1086 There was a problem with the installation:
1085 There was a problem with the installation:
1087 %s
1086 %s
1088 Try to correct it or contact the developers if you think it's a bug.
1087 Try to correct it or contact the developers if you think it's a bug.
1089 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1088 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1090 warn(warning)
1089 warn(warning)
1091 wait()
1090 wait()
1092 return
1091 return
1093
1092
1094 elif mode == 'upgrade':
1093 elif mode == 'upgrade':
1095 try:
1094 try:
1096 os.chdir(ipythondir)
1095 os.chdir(ipythondir)
1097 except:
1096 except:
1098 print """
1097 print """
1099 Can not upgrade: changing to directory %s failed. Details:
1098 Can not upgrade: changing to directory %s failed. Details:
1100 %s
1099 %s
1101 """ % (ipythondir,sys.exc_info()[1])
1100 """ % (ipythondir,sys.exc_info()[1])
1102 wait()
1101 wait()
1103 return
1102 return
1104 else:
1103 else:
1105 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1104 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1106 for new_full_path in sources:
1105 for new_full_path in sources:
1107 new_filename = os.path.basename(new_full_path)
1106 new_filename = os.path.basename(new_full_path)
1108 if new_filename.startswith('ipythonrc'):
1107 if new_filename.startswith('ipythonrc'):
1109 new_filename = new_filename + rc_suffix
1108 new_filename = new_filename + rc_suffix
1110 # The config directory should only contain files, skip any
1109 # The config directory should only contain files, skip any
1111 # directories which may be there (like CVS)
1110 # directories which may be there (like CVS)
1112 if os.path.isdir(new_full_path):
1111 if os.path.isdir(new_full_path):
1113 continue
1112 continue
1114 if os.path.exists(new_filename):
1113 if os.path.exists(new_filename):
1115 old_file = new_filename+'.old'
1114 old_file = new_filename+'.old'
1116 if os.path.exists(old_file):
1115 if os.path.exists(old_file):
1117 os.remove(old_file)
1116 os.remove(old_file)
1118 os.rename(new_filename,old_file)
1117 os.rename(new_filename,old_file)
1119 shutil.copy(new_full_path,new_filename)
1118 shutil.copy(new_full_path,new_filename)
1120 else:
1119 else:
1121 raise ValueError,'unrecognized mode for install:',`mode`
1120 raise ValueError,'unrecognized mode for install:',`mode`
1122
1121
1123 # Fix line-endings to those native to each platform in the config
1122 # Fix line-endings to those native to each platform in the config
1124 # directory.
1123 # directory.
1125 try:
1124 try:
1126 os.chdir(ipythondir)
1125 os.chdir(ipythondir)
1127 except:
1126 except:
1128 print """
1127 print """
1129 Problem: changing to directory %s failed.
1128 Problem: changing to directory %s failed.
1130 Details:
1129 Details:
1131 %s
1130 %s
1132
1131
1133 Some configuration files may have incorrect line endings. This should not
1132 Some configuration files may have incorrect line endings. This should not
1134 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1133 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1135 wait()
1134 wait()
1136 else:
1135 else:
1137 for fname in glb('ipythonrc*'):
1136 for fname in glb('ipythonrc*'):
1138 try:
1137 try:
1139 native_line_ends(fname,backup=0)
1138 native_line_ends(fname,backup=0)
1140 except IOError:
1139 except IOError:
1141 pass
1140 pass
1142
1141
1143 if mode == 'install':
1142 if mode == 'install':
1144 print """
1143 print """
1145 Successful installation!
1144 Successful installation!
1146
1145
1147 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1146 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1148 IPython manual (there are both HTML and PDF versions supplied with the
1147 IPython manual (there are both HTML and PDF versions supplied with the
1149 distribution) to make sure that your system environment is properly configured
1148 distribution) to make sure that your system environment is properly configured
1150 to take advantage of IPython's features.
1149 to take advantage of IPython's features.
1151
1150
1152 Important note: the configuration system has changed! The old system is
1151 Important note: the configuration system has changed! The old system is
1153 still in place, but its setting may be partly overridden by the settings in
1152 still in place, but its setting may be partly overridden by the settings in
1154 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1153 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1155 if some of the new settings bother you.
1154 if some of the new settings bother you.
1156
1155
1157 """
1156 """
1158 else:
1157 else:
1159 print """
1158 print """
1160 Successful upgrade!
1159 Successful upgrade!
1161
1160
1162 All files in your directory:
1161 All files in your directory:
1163 %(ipythondir)s
1162 %(ipythondir)s
1164 which would have been overwritten by the upgrade were backed up with a .old
1163 which would have been overwritten by the upgrade were backed up with a .old
1165 extension. If you had made particular customizations in those files you may
1164 extension. If you had made particular customizations in those files you may
1166 want to merge them back into the new files.""" % locals()
1165 want to merge them back into the new files.""" % locals()
1167 wait()
1166 wait()
1168 os.chdir(cwd)
1167 os.chdir(cwd)
1169 # end user_setup()
1168 # end user_setup()
1170
1169
1171 def atexit_operations(self):
1170 def atexit_operations(self):
1172 """This will be executed at the time of exit.
1171 """This will be executed at the time of exit.
1173
1172
1174 Saving of persistent data should be performed here. """
1173 Saving of persistent data should be performed here. """
1175
1174
1176 #print '*** IPython exit cleanup ***' # dbg
1175 #print '*** IPython exit cleanup ***' # dbg
1177 # input history
1176 # input history
1178 self.savehist()
1177 self.savehist()
1179
1178
1180 # Cleanup all tempfiles left around
1179 # Cleanup all tempfiles left around
1181 for tfile in self.tempfiles:
1180 for tfile in self.tempfiles:
1182 try:
1181 try:
1183 os.unlink(tfile)
1182 os.unlink(tfile)
1184 except OSError:
1183 except OSError:
1185 pass
1184 pass
1186
1185
1187 # save the "persistent data" catch-all dictionary
1186 # save the "persistent data" catch-all dictionary
1188 self.hooks.shutdown_hook()
1187 self.hooks.shutdown_hook()
1189
1188
1190 def savehist(self):
1189 def savehist(self):
1191 """Save input history to a file (via readline library)."""
1190 """Save input history to a file (via readline library)."""
1192 try:
1191 try:
1193 self.readline.write_history_file(self.histfile)
1192 self.readline.write_history_file(self.histfile)
1194 except:
1193 except:
1195 print 'Unable to save IPython command history to file: ' + \
1194 print 'Unable to save IPython command history to file: ' + \
1196 `self.histfile`
1195 `self.histfile`
1197
1196
1198 def pre_readline(self):
1197 def pre_readline(self):
1199 """readline hook to be used at the start of each line.
1198 """readline hook to be used at the start of each line.
1200
1199
1201 Currently it handles auto-indent only."""
1200 Currently it handles auto-indent only."""
1202
1201
1203 #debugx('self.indent_current_nsp','pre_readline:')
1202 #debugx('self.indent_current_nsp','pre_readline:')
1204 self.readline.insert_text(self.indent_current_str())
1203 self.readline.insert_text(self.indent_current_str())
1205
1204
1206 def init_readline(self):
1205 def init_readline(self):
1207 """Command history completion/saving/reloading."""
1206 """Command history completion/saving/reloading."""
1208
1207
1209 import IPython.rlineimpl as readline
1208 import IPython.rlineimpl as readline
1210 if not readline.have_readline:
1209 if not readline.have_readline:
1211 self.has_readline = 0
1210 self.has_readline = 0
1212 self.readline = None
1211 self.readline = None
1213 # no point in bugging windows users with this every time:
1212 # no point in bugging windows users with this every time:
1214 warn('Readline services not available on this platform.')
1213 warn('Readline services not available on this platform.')
1215 else:
1214 else:
1216 sys.modules['readline'] = readline
1215 sys.modules['readline'] = readline
1217 import atexit
1216 import atexit
1218 from IPython.completer import IPCompleter
1217 from IPython.completer import IPCompleter
1219 self.Completer = IPCompleter(self,
1218 self.Completer = IPCompleter(self,
1220 self.user_ns,
1219 self.user_ns,
1221 self.user_global_ns,
1220 self.user_global_ns,
1222 self.rc.readline_omit__names,
1221 self.rc.readline_omit__names,
1223 self.alias_table)
1222 self.alias_table)
1224
1223
1225 # Platform-specific configuration
1224 # Platform-specific configuration
1226 if os.name == 'nt':
1225 if os.name == 'nt':
1227 self.readline_startup_hook = readline.set_pre_input_hook
1226 self.readline_startup_hook = readline.set_pre_input_hook
1228 else:
1227 else:
1229 self.readline_startup_hook = readline.set_startup_hook
1228 self.readline_startup_hook = readline.set_startup_hook
1230
1229
1231 # Load user's initrc file (readline config)
1230 # Load user's initrc file (readline config)
1232 inputrc_name = os.environ.get('INPUTRC')
1231 inputrc_name = os.environ.get('INPUTRC')
1233 if inputrc_name is None:
1232 if inputrc_name is None:
1234 home_dir = get_home_dir()
1233 home_dir = get_home_dir()
1235 if home_dir is not None:
1234 if home_dir is not None:
1236 inputrc_name = os.path.join(home_dir,'.inputrc')
1235 inputrc_name = os.path.join(home_dir,'.inputrc')
1237 if os.path.isfile(inputrc_name):
1236 if os.path.isfile(inputrc_name):
1238 try:
1237 try:
1239 readline.read_init_file(inputrc_name)
1238 readline.read_init_file(inputrc_name)
1240 except:
1239 except:
1241 warn('Problems reading readline initialization file <%s>'
1240 warn('Problems reading readline initialization file <%s>'
1242 % inputrc_name)
1241 % inputrc_name)
1243
1242
1244 self.has_readline = 1
1243 self.has_readline = 1
1245 self.readline = readline
1244 self.readline = readline
1246 # save this in sys so embedded copies can restore it properly
1245 # save this in sys so embedded copies can restore it properly
1247 sys.ipcompleter = self.Completer.complete
1246 sys.ipcompleter = self.Completer.complete
1248 readline.set_completer(self.Completer.complete)
1247 readline.set_completer(self.Completer.complete)
1249
1248
1250 # Configure readline according to user's prefs
1249 # Configure readline according to user's prefs
1251 for rlcommand in self.rc.readline_parse_and_bind:
1250 for rlcommand in self.rc.readline_parse_and_bind:
1252 readline.parse_and_bind(rlcommand)
1251 readline.parse_and_bind(rlcommand)
1253
1252
1254 # remove some chars from the delimiters list
1253 # remove some chars from the delimiters list
1255 delims = readline.get_completer_delims()
1254 delims = readline.get_completer_delims()
1256 delims = delims.translate(string._idmap,
1255 delims = delims.translate(string._idmap,
1257 self.rc.readline_remove_delims)
1256 self.rc.readline_remove_delims)
1258 readline.set_completer_delims(delims)
1257 readline.set_completer_delims(delims)
1259 # otherwise we end up with a monster history after a while:
1258 # otherwise we end up with a monster history after a while:
1260 readline.set_history_length(1000)
1259 readline.set_history_length(1000)
1261 try:
1260 try:
1262 #print '*** Reading readline history' # dbg
1261 #print '*** Reading readline history' # dbg
1263 readline.read_history_file(self.histfile)
1262 readline.read_history_file(self.histfile)
1264 except IOError:
1263 except IOError:
1265 pass # It doesn't exist yet.
1264 pass # It doesn't exist yet.
1266
1265
1267 atexit.register(self.atexit_operations)
1266 atexit.register(self.atexit_operations)
1268 del atexit
1267 del atexit
1269
1268
1270 # Configure auto-indent for all platforms
1269 # Configure auto-indent for all platforms
1271 self.set_autoindent(self.rc.autoindent)
1270 self.set_autoindent(self.rc.autoindent)
1272
1271
1273 def ask_yes_no(self,prompt,default=True):
1272 def ask_yes_no(self,prompt,default=True):
1274 if self.rc.quiet:
1273 if self.rc.quiet:
1275 return True
1274 return True
1276 return ask_yes_no(prompt,default)
1275 return ask_yes_no(prompt,default)
1277
1276
1278 def _should_recompile(self,e):
1277 def _should_recompile(self,e):
1279 """Utility routine for edit_syntax_error"""
1278 """Utility routine for edit_syntax_error"""
1280
1279
1281 if e.filename in ('<ipython console>','<input>','<string>',
1280 if e.filename in ('<ipython console>','<input>','<string>',
1282 '<console>','<BackgroundJob compilation>',
1281 '<console>','<BackgroundJob compilation>',
1283 None):
1282 None):
1284
1283
1285 return False
1284 return False
1286 try:
1285 try:
1287 if (self.rc.autoedit_syntax and
1286 if (self.rc.autoedit_syntax and
1288 not self.ask_yes_no('Return to editor to correct syntax error? '
1287 not self.ask_yes_no('Return to editor to correct syntax error? '
1289 '[Y/n] ','y')):
1288 '[Y/n] ','y')):
1290 return False
1289 return False
1291 except EOFError:
1290 except EOFError:
1292 return False
1291 return False
1293
1292
1294 def int0(x):
1293 def int0(x):
1295 try:
1294 try:
1296 return int(x)
1295 return int(x)
1297 except TypeError:
1296 except TypeError:
1298 return 0
1297 return 0
1299 # always pass integer line and offset values to editor hook
1298 # always pass integer line and offset values to editor hook
1300 self.hooks.fix_error_editor(e.filename,
1299 self.hooks.fix_error_editor(e.filename,
1301 int0(e.lineno),int0(e.offset),e.msg)
1300 int0(e.lineno),int0(e.offset),e.msg)
1302 return True
1301 return True
1303
1302
1304 def edit_syntax_error(self):
1303 def edit_syntax_error(self):
1305 """The bottom half of the syntax error handler called in the main loop.
1304 """The bottom half of the syntax error handler called in the main loop.
1306
1305
1307 Loop until syntax error is fixed or user cancels.
1306 Loop until syntax error is fixed or user cancels.
1308 """
1307 """
1309
1308
1310 while self.SyntaxTB.last_syntax_error:
1309 while self.SyntaxTB.last_syntax_error:
1311 # copy and clear last_syntax_error
1310 # copy and clear last_syntax_error
1312 err = self.SyntaxTB.clear_err_state()
1311 err = self.SyntaxTB.clear_err_state()
1313 if not self._should_recompile(err):
1312 if not self._should_recompile(err):
1314 return
1313 return
1315 try:
1314 try:
1316 # may set last_syntax_error again if a SyntaxError is raised
1315 # may set last_syntax_error again if a SyntaxError is raised
1317 self.safe_execfile(err.filename,self.user_ns)
1316 self.safe_execfile(err.filename,self.user_ns)
1318 except:
1317 except:
1319 self.showtraceback()
1318 self.showtraceback()
1320 else:
1319 else:
1321 try:
1320 try:
1322 f = file(err.filename)
1321 f = file(err.filename)
1323 try:
1322 try:
1324 sys.displayhook(f.read())
1323 sys.displayhook(f.read())
1325 finally:
1324 finally:
1326 f.close()
1325 f.close()
1327 except:
1326 except:
1328 self.showtraceback()
1327 self.showtraceback()
1329
1328
1330 def showsyntaxerror(self, filename=None):
1329 def showsyntaxerror(self, filename=None):
1331 """Display the syntax error that just occurred.
1330 """Display the syntax error that just occurred.
1332
1331
1333 This doesn't display a stack trace because there isn't one.
1332 This doesn't display a stack trace because there isn't one.
1334
1333
1335 If a filename is given, it is stuffed in the exception instead
1334 If a filename is given, it is stuffed in the exception instead
1336 of what was there before (because Python's parser always uses
1335 of what was there before (because Python's parser always uses
1337 "<string>" when reading from a string).
1336 "<string>" when reading from a string).
1338 """
1337 """
1339 etype, value, last_traceback = sys.exc_info()
1338 etype, value, last_traceback = sys.exc_info()
1340
1339
1341 # See note about these variables in showtraceback() below
1340 # See note about these variables in showtraceback() below
1342 sys.last_type = etype
1341 sys.last_type = etype
1343 sys.last_value = value
1342 sys.last_value = value
1344 sys.last_traceback = last_traceback
1343 sys.last_traceback = last_traceback
1345
1344
1346 if filename and etype is SyntaxError:
1345 if filename and etype is SyntaxError:
1347 # Work hard to stuff the correct filename in the exception
1346 # Work hard to stuff the correct filename in the exception
1348 try:
1347 try:
1349 msg, (dummy_filename, lineno, offset, line) = value
1348 msg, (dummy_filename, lineno, offset, line) = value
1350 except:
1349 except:
1351 # Not the format we expect; leave it alone
1350 # Not the format we expect; leave it alone
1352 pass
1351 pass
1353 else:
1352 else:
1354 # Stuff in the right filename
1353 # Stuff in the right filename
1355 try:
1354 try:
1356 # Assume SyntaxError is a class exception
1355 # Assume SyntaxError is a class exception
1357 value = SyntaxError(msg, (filename, lineno, offset, line))
1356 value = SyntaxError(msg, (filename, lineno, offset, line))
1358 except:
1357 except:
1359 # If that failed, assume SyntaxError is a string
1358 # If that failed, assume SyntaxError is a string
1360 value = msg, (filename, lineno, offset, line)
1359 value = msg, (filename, lineno, offset, line)
1361 self.SyntaxTB(etype,value,[])
1360 self.SyntaxTB(etype,value,[])
1362
1361
1363 def debugger(self):
1362 def debugger(self):
1364 """Call the pdb debugger."""
1363 """Call the pydb/pdb debugger."""
1365
1364
1366 if not self.rc.pdb:
1365 if not self.rc.pdb:
1367 return
1366 return
1368 pdb.pm()
1367 have_pydb = False
1368 if sys.version[:3] >= '2.5':
1369 try:
1370 from pydb import pm
1371 have_pydb = True
1372 except ImportError:
1373 pass
1374 if not have_pydb:
1375 from pdb import pm
1376 pm()
1369
1377
1370 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1378 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1371 """Display the exception that just occurred.
1379 """Display the exception that just occurred.
1372
1380
1373 If nothing is known about the exception, this is the method which
1381 If nothing is known about the exception, this is the method which
1374 should be used throughout the code for presenting user tracebacks,
1382 should be used throughout the code for presenting user tracebacks,
1375 rather than directly invoking the InteractiveTB object.
1383 rather than directly invoking the InteractiveTB object.
1376
1384
1377 A specific showsyntaxerror() also exists, but this method can take
1385 A specific showsyntaxerror() also exists, but this method can take
1378 care of calling it if needed, so unless you are explicitly catching a
1386 care of calling it if needed, so unless you are explicitly catching a
1379 SyntaxError exception, don't try to analyze the stack manually and
1387 SyntaxError exception, don't try to analyze the stack manually and
1380 simply call this method."""
1388 simply call this method."""
1381
1389
1382 # Though this won't be called by syntax errors in the input line,
1390 # Though this won't be called by syntax errors in the input line,
1383 # there may be SyntaxError cases whith imported code.
1391 # there may be SyntaxError cases whith imported code.
1384 if exc_tuple is None:
1392 if exc_tuple is None:
1385 etype, value, tb = sys.exc_info()
1393 etype, value, tb = sys.exc_info()
1386 else:
1394 else:
1387 etype, value, tb = exc_tuple
1395 etype, value, tb = exc_tuple
1388 if etype is SyntaxError:
1396 if etype is SyntaxError:
1389 self.showsyntaxerror(filename)
1397 self.showsyntaxerror(filename)
1390 else:
1398 else:
1391 # WARNING: these variables are somewhat deprecated and not
1399 # WARNING: these variables are somewhat deprecated and not
1392 # necessarily safe to use in a threaded environment, but tools
1400 # necessarily safe to use in a threaded environment, but tools
1393 # like pdb depend on their existence, so let's set them. If we
1401 # like pdb depend on their existence, so let's set them. If we
1394 # find problems in the field, we'll need to revisit their use.
1402 # find problems in the field, we'll need to revisit their use.
1395 sys.last_type = etype
1403 sys.last_type = etype
1396 sys.last_value = value
1404 sys.last_value = value
1397 sys.last_traceback = tb
1405 sys.last_traceback = tb
1398
1406
1399 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1407 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1400 if self.InteractiveTB.call_pdb and self.has_readline:
1408 if self.InteractiveTB.call_pdb and self.has_readline:
1401 # pdb mucks up readline, fix it back
1409 # pdb mucks up readline, fix it back
1402 self.readline.set_completer(self.Completer.complete)
1410 self.readline.set_completer(self.Completer.complete)
1403
1411
1404 def mainloop(self,banner=None):
1412 def mainloop(self,banner=None):
1405 """Creates the local namespace and starts the mainloop.
1413 """Creates the local namespace and starts the mainloop.
1406
1414
1407 If an optional banner argument is given, it will override the
1415 If an optional banner argument is given, it will override the
1408 internally created default banner."""
1416 internally created default banner."""
1409
1417
1410 if self.rc.c: # Emulate Python's -c option
1418 if self.rc.c: # Emulate Python's -c option
1411 self.exec_init_cmd()
1419 self.exec_init_cmd()
1412 if banner is None:
1420 if banner is None:
1413 if not self.rc.banner:
1421 if not self.rc.banner:
1414 banner = ''
1422 banner = ''
1415 # banner is string? Use it directly!
1423 # banner is string? Use it directly!
1416 elif isinstance(self.rc.banner,basestring):
1424 elif isinstance(self.rc.banner,basestring):
1417 banner = self.rc.banner
1425 banner = self.rc.banner
1418 else:
1426 else:
1419 banner = self.BANNER+self.banner2
1427 banner = self.BANNER+self.banner2
1420
1428
1421 self.interact(banner)
1429 self.interact(banner)
1422
1430
1423 def exec_init_cmd(self):
1431 def exec_init_cmd(self):
1424 """Execute a command given at the command line.
1432 """Execute a command given at the command line.
1425
1433
1426 This emulates Python's -c option."""
1434 This emulates Python's -c option."""
1427
1435
1428 #sys.argv = ['-c']
1436 #sys.argv = ['-c']
1429 self.push(self.rc.c)
1437 self.push(self.rc.c)
1430
1438
1431 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1439 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1432 """Embeds IPython into a running python program.
1440 """Embeds IPython into a running python program.
1433
1441
1434 Input:
1442 Input:
1435
1443
1436 - header: An optional header message can be specified.
1444 - header: An optional header message can be specified.
1437
1445
1438 - local_ns, global_ns: working namespaces. If given as None, the
1446 - local_ns, global_ns: working namespaces. If given as None, the
1439 IPython-initialized one is updated with __main__.__dict__, so that
1447 IPython-initialized one is updated with __main__.__dict__, so that
1440 program variables become visible but user-specific configuration
1448 program variables become visible but user-specific configuration
1441 remains possible.
1449 remains possible.
1442
1450
1443 - stack_depth: specifies how many levels in the stack to go to
1451 - stack_depth: specifies how many levels in the stack to go to
1444 looking for namespaces (when local_ns and global_ns are None). This
1452 looking for namespaces (when local_ns and global_ns are None). This
1445 allows an intermediate caller to make sure that this function gets
1453 allows an intermediate caller to make sure that this function gets
1446 the namespace from the intended level in the stack. By default (0)
1454 the namespace from the intended level in the stack. By default (0)
1447 it will get its locals and globals from the immediate caller.
1455 it will get its locals and globals from the immediate caller.
1448
1456
1449 Warning: it's possible to use this in a program which is being run by
1457 Warning: it's possible to use this in a program which is being run by
1450 IPython itself (via %run), but some funny things will happen (a few
1458 IPython itself (via %run), but some funny things will happen (a few
1451 globals get overwritten). In the future this will be cleaned up, as
1459 globals get overwritten). In the future this will be cleaned up, as
1452 there is no fundamental reason why it can't work perfectly."""
1460 there is no fundamental reason why it can't work perfectly."""
1453
1461
1454 # Get locals and globals from caller
1462 # Get locals and globals from caller
1455 if local_ns is None or global_ns is None:
1463 if local_ns is None or global_ns is None:
1456 call_frame = sys._getframe(stack_depth).f_back
1464 call_frame = sys._getframe(stack_depth).f_back
1457
1465
1458 if local_ns is None:
1466 if local_ns is None:
1459 local_ns = call_frame.f_locals
1467 local_ns = call_frame.f_locals
1460 if global_ns is None:
1468 if global_ns is None:
1461 global_ns = call_frame.f_globals
1469 global_ns = call_frame.f_globals
1462
1470
1463 # Update namespaces and fire up interpreter
1471 # Update namespaces and fire up interpreter
1464
1472
1465 # The global one is easy, we can just throw it in
1473 # The global one is easy, we can just throw it in
1466 self.user_global_ns = global_ns
1474 self.user_global_ns = global_ns
1467
1475
1468 # but the user/local one is tricky: ipython needs it to store internal
1476 # but the user/local one is tricky: ipython needs it to store internal
1469 # data, but we also need the locals. We'll copy locals in the user
1477 # data, but we also need the locals. We'll copy locals in the user
1470 # one, but will track what got copied so we can delete them at exit.
1478 # one, but will track what got copied so we can delete them at exit.
1471 # This is so that a later embedded call doesn't see locals from a
1479 # This is so that a later embedded call doesn't see locals from a
1472 # previous call (which most likely existed in a separate scope).
1480 # previous call (which most likely existed in a separate scope).
1473 local_varnames = local_ns.keys()
1481 local_varnames = local_ns.keys()
1474 self.user_ns.update(local_ns)
1482 self.user_ns.update(local_ns)
1475
1483
1476 # Patch for global embedding to make sure that things don't overwrite
1484 # Patch for global embedding to make sure that things don't overwrite
1477 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1485 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1478 # FIXME. Test this a bit more carefully (the if.. is new)
1486 # FIXME. Test this a bit more carefully (the if.. is new)
1479 if local_ns is None and global_ns is None:
1487 if local_ns is None and global_ns is None:
1480 self.user_global_ns.update(__main__.__dict__)
1488 self.user_global_ns.update(__main__.__dict__)
1481
1489
1482 # make sure the tab-completer has the correct frame information, so it
1490 # make sure the tab-completer has the correct frame information, so it
1483 # actually completes using the frame's locals/globals
1491 # actually completes using the frame's locals/globals
1484 self.set_completer_frame()
1492 self.set_completer_frame()
1485
1493
1486 # before activating the interactive mode, we need to make sure that
1494 # before activating the interactive mode, we need to make sure that
1487 # all names in the builtin namespace needed by ipython point to
1495 # all names in the builtin namespace needed by ipython point to
1488 # ourselves, and not to other instances.
1496 # ourselves, and not to other instances.
1489 self.add_builtins()
1497 self.add_builtins()
1490
1498
1491 self.interact(header)
1499 self.interact(header)
1492
1500
1493 # now, purge out the user namespace from anything we might have added
1501 # now, purge out the user namespace from anything we might have added
1494 # from the caller's local namespace
1502 # from the caller's local namespace
1495 delvar = self.user_ns.pop
1503 delvar = self.user_ns.pop
1496 for var in local_varnames:
1504 for var in local_varnames:
1497 delvar(var,None)
1505 delvar(var,None)
1498 # and clean builtins we may have overridden
1506 # and clean builtins we may have overridden
1499 self.clean_builtins()
1507 self.clean_builtins()
1500
1508
1501 def interact(self, banner=None):
1509 def interact(self, banner=None):
1502 """Closely emulate the interactive Python console.
1510 """Closely emulate the interactive Python console.
1503
1511
1504 The optional banner argument specify the banner to print
1512 The optional banner argument specify the banner to print
1505 before the first interaction; by default it prints a banner
1513 before the first interaction; by default it prints a banner
1506 similar to the one printed by the real Python interpreter,
1514 similar to the one printed by the real Python interpreter,
1507 followed by the current class name in parentheses (so as not
1515 followed by the current class name in parentheses (so as not
1508 to confuse this with the real interpreter -- since it's so
1516 to confuse this with the real interpreter -- since it's so
1509 close!).
1517 close!).
1510
1518
1511 """
1519 """
1512
1520
1513 if self.exit_now:
1521 if self.exit_now:
1514 # batch run -> do not interact
1522 # batch run -> do not interact
1515 return
1523 return
1516 cprt = 'Type "copyright", "credits" or "license" for more information.'
1524 cprt = 'Type "copyright", "credits" or "license" for more information.'
1517 if banner is None:
1525 if banner is None:
1518 self.write("Python %s on %s\n%s\n(%s)\n" %
1526 self.write("Python %s on %s\n%s\n(%s)\n" %
1519 (sys.version, sys.platform, cprt,
1527 (sys.version, sys.platform, cprt,
1520 self.__class__.__name__))
1528 self.__class__.__name__))
1521 else:
1529 else:
1522 self.write(banner)
1530 self.write(banner)
1523
1531
1524 more = 0
1532 more = 0
1525
1533
1526 # Mark activity in the builtins
1534 # Mark activity in the builtins
1527 __builtin__.__dict__['__IPYTHON__active'] += 1
1535 __builtin__.__dict__['__IPYTHON__active'] += 1
1528
1536
1529 # exit_now is set by a call to %Exit or %Quit
1537 # exit_now is set by a call to %Exit or %Quit
1530 while not self.exit_now:
1538 while not self.exit_now:
1531 if more:
1539 if more:
1532 prompt = self.hooks.generate_prompt(True)
1540 prompt = self.hooks.generate_prompt(True)
1533 if self.autoindent:
1541 if self.autoindent:
1534 self.readline_startup_hook(self.pre_readline)
1542 self.readline_startup_hook(self.pre_readline)
1535 else:
1543 else:
1536 prompt = self.hooks.generate_prompt(False)
1544 prompt = self.hooks.generate_prompt(False)
1537 try:
1545 try:
1538 line = self.raw_input(prompt,more)
1546 line = self.raw_input(prompt,more)
1539 if self.exit_now:
1547 if self.exit_now:
1540 # quick exit on sys.std[in|out] close
1548 # quick exit on sys.std[in|out] close
1541 break
1549 break
1542 if self.autoindent:
1550 if self.autoindent:
1543 self.readline_startup_hook(None)
1551 self.readline_startup_hook(None)
1544 except KeyboardInterrupt:
1552 except KeyboardInterrupt:
1545 self.write('\nKeyboardInterrupt\n')
1553 self.write('\nKeyboardInterrupt\n')
1546 self.resetbuffer()
1554 self.resetbuffer()
1547 # keep cache in sync with the prompt counter:
1555 # keep cache in sync with the prompt counter:
1548 self.outputcache.prompt_count -= 1
1556 self.outputcache.prompt_count -= 1
1549
1557
1550 if self.autoindent:
1558 if self.autoindent:
1551 self.indent_current_nsp = 0
1559 self.indent_current_nsp = 0
1552 more = 0
1560 more = 0
1553 except EOFError:
1561 except EOFError:
1554 if self.autoindent:
1562 if self.autoindent:
1555 self.readline_startup_hook(None)
1563 self.readline_startup_hook(None)
1556 self.write('\n')
1564 self.write('\n')
1557 self.exit()
1565 self.exit()
1558 except bdb.BdbQuit:
1566 except bdb.BdbQuit:
1559 warn('The Python debugger has exited with a BdbQuit exception.\n'
1567 warn('The Python debugger has exited with a BdbQuit exception.\n'
1560 'Because of how pdb handles the stack, it is impossible\n'
1568 'Because of how pdb handles the stack, it is impossible\n'
1561 'for IPython to properly format this particular exception.\n'
1569 'for IPython to properly format this particular exception.\n'
1562 'IPython will resume normal operation.')
1570 'IPython will resume normal operation.')
1563 except:
1571 except:
1564 # exceptions here are VERY RARE, but they can be triggered
1572 # exceptions here are VERY RARE, but they can be triggered
1565 # asynchronously by signal handlers, for example.
1573 # asynchronously by signal handlers, for example.
1566 self.showtraceback()
1574 self.showtraceback()
1567 else:
1575 else:
1568 more = self.push(line)
1576 more = self.push(line)
1569 if (self.SyntaxTB.last_syntax_error and
1577 if (self.SyntaxTB.last_syntax_error and
1570 self.rc.autoedit_syntax):
1578 self.rc.autoedit_syntax):
1571 self.edit_syntax_error()
1579 self.edit_syntax_error()
1572
1580
1573 # We are off again...
1581 # We are off again...
1574 __builtin__.__dict__['__IPYTHON__active'] -= 1
1582 __builtin__.__dict__['__IPYTHON__active'] -= 1
1575
1583
1576 def excepthook(self, etype, value, tb):
1584 def excepthook(self, etype, value, tb):
1577 """One more defense for GUI apps that call sys.excepthook.
1585 """One more defense for GUI apps that call sys.excepthook.
1578
1586
1579 GUI frameworks like wxPython trap exceptions and call
1587 GUI frameworks like wxPython trap exceptions and call
1580 sys.excepthook themselves. I guess this is a feature that
1588 sys.excepthook themselves. I guess this is a feature that
1581 enables them to keep running after exceptions that would
1589 enables them to keep running after exceptions that would
1582 otherwise kill their mainloop. This is a bother for IPython
1590 otherwise kill their mainloop. This is a bother for IPython
1583 which excepts to catch all of the program exceptions with a try:
1591 which excepts to catch all of the program exceptions with a try:
1584 except: statement.
1592 except: statement.
1585
1593
1586 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1594 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1587 any app directly invokes sys.excepthook, it will look to the user like
1595 any app directly invokes sys.excepthook, it will look to the user like
1588 IPython crashed. In order to work around this, we can disable the
1596 IPython crashed. In order to work around this, we can disable the
1589 CrashHandler and replace it with this excepthook instead, which prints a
1597 CrashHandler and replace it with this excepthook instead, which prints a
1590 regular traceback using our InteractiveTB. In this fashion, apps which
1598 regular traceback using our InteractiveTB. In this fashion, apps which
1591 call sys.excepthook will generate a regular-looking exception from
1599 call sys.excepthook will generate a regular-looking exception from
1592 IPython, and the CrashHandler will only be triggered by real IPython
1600 IPython, and the CrashHandler will only be triggered by real IPython
1593 crashes.
1601 crashes.
1594
1602
1595 This hook should be used sparingly, only in places which are not likely
1603 This hook should be used sparingly, only in places which are not likely
1596 to be true IPython errors.
1604 to be true IPython errors.
1597 """
1605 """
1598 self.showtraceback((etype,value,tb),tb_offset=0)
1606 self.showtraceback((etype,value,tb),tb_offset=0)
1599
1607
1600 def expand_aliases(self,fn,rest):
1608 def expand_aliases(self,fn,rest):
1601 """ Expand multiple levels of aliases:
1609 """ Expand multiple levels of aliases:
1602
1610
1603 if:
1611 if:
1604
1612
1605 alias foo bar /tmp
1613 alias foo bar /tmp
1606 alias baz foo
1614 alias baz foo
1607
1615
1608 then:
1616 then:
1609
1617
1610 baz huhhahhei -> bar /tmp huhhahhei
1618 baz huhhahhei -> bar /tmp huhhahhei
1611
1619
1612 """
1620 """
1613 line = fn + " " + rest
1621 line = fn + " " + rest
1614
1622
1615 done = Set()
1623 done = Set()
1616 while 1:
1624 while 1:
1617 pre,fn,rest = self.split_user_input(line)
1625 pre,fn,rest = self.split_user_input(line)
1618 if fn in self.alias_table:
1626 if fn in self.alias_table:
1619 if fn in done:
1627 if fn in done:
1620 warn("Cyclic alias definition, repeated '%s'" % fn)
1628 warn("Cyclic alias definition, repeated '%s'" % fn)
1621 return ""
1629 return ""
1622 done.add(fn)
1630 done.add(fn)
1623
1631
1624 l2 = self.transform_alias(fn,rest)
1632 l2 = self.transform_alias(fn,rest)
1625 # dir -> dir
1633 # dir -> dir
1626 if l2 == line:
1634 if l2 == line:
1627 break
1635 break
1628 # ls -> ls -F should not recurse forever
1636 # ls -> ls -F should not recurse forever
1629 if l2.split(None,1)[0] == line.split(None,1)[0]:
1637 if l2.split(None,1)[0] == line.split(None,1)[0]:
1630 line = l2
1638 line = l2
1631 break
1639 break
1632
1640
1633 line=l2
1641 line=l2
1634
1642
1635
1643
1636 # print "al expand to",line #dbg
1644 # print "al expand to",line #dbg
1637 else:
1645 else:
1638 break
1646 break
1639
1647
1640 return line
1648 return line
1641
1649
1642 def transform_alias(self, alias,rest=''):
1650 def transform_alias(self, alias,rest=''):
1643 """ Transform alias to system command string.
1651 """ Transform alias to system command string.
1644 """
1652 """
1645 nargs,cmd = self.alias_table[alias]
1653 nargs,cmd = self.alias_table[alias]
1646 if ' ' in cmd and os.path.isfile(cmd):
1654 if ' ' in cmd and os.path.isfile(cmd):
1647 cmd = '"%s"' % cmd
1655 cmd = '"%s"' % cmd
1648
1656
1649 # Expand the %l special to be the user's input line
1657 # Expand the %l special to be the user's input line
1650 if cmd.find('%l') >= 0:
1658 if cmd.find('%l') >= 0:
1651 cmd = cmd.replace('%l',rest)
1659 cmd = cmd.replace('%l',rest)
1652 rest = ''
1660 rest = ''
1653 if nargs==0:
1661 if nargs==0:
1654 # Simple, argument-less aliases
1662 # Simple, argument-less aliases
1655 cmd = '%s %s' % (cmd,rest)
1663 cmd = '%s %s' % (cmd,rest)
1656 else:
1664 else:
1657 # Handle aliases with positional arguments
1665 # Handle aliases with positional arguments
1658 args = rest.split(None,nargs)
1666 args = rest.split(None,nargs)
1659 if len(args)< nargs:
1667 if len(args)< nargs:
1660 error('Alias <%s> requires %s arguments, %s given.' %
1668 error('Alias <%s> requires %s arguments, %s given.' %
1661 (alias,nargs,len(args)))
1669 (alias,nargs,len(args)))
1662 return None
1670 return None
1663 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1671 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1664 # Now call the macro, evaluating in the user's namespace
1672 # Now call the macro, evaluating in the user's namespace
1665 #print 'new command: <%r>' % cmd # dbg
1673 #print 'new command: <%r>' % cmd # dbg
1666 return cmd
1674 return cmd
1667
1675
1668 def call_alias(self,alias,rest=''):
1676 def call_alias(self,alias,rest=''):
1669 """Call an alias given its name and the rest of the line.
1677 """Call an alias given its name and the rest of the line.
1670
1678
1671 This is only used to provide backwards compatibility for users of
1679 This is only used to provide backwards compatibility for users of
1672 ipalias(), use of which is not recommended for anymore."""
1680 ipalias(), use of which is not recommended for anymore."""
1673
1681
1674 # Now call the macro, evaluating in the user's namespace
1682 # Now call the macro, evaluating in the user's namespace
1675 cmd = self.transform_alias(alias, rest)
1683 cmd = self.transform_alias(alias, rest)
1676 try:
1684 try:
1677 self.system(cmd)
1685 self.system(cmd)
1678 except:
1686 except:
1679 self.showtraceback()
1687 self.showtraceback()
1680
1688
1681 def indent_current_str(self):
1689 def indent_current_str(self):
1682 """return the current level of indentation as a string"""
1690 """return the current level of indentation as a string"""
1683 return self.indent_current_nsp * ' '
1691 return self.indent_current_nsp * ' '
1684
1692
1685 def autoindent_update(self,line):
1693 def autoindent_update(self,line):
1686 """Keep track of the indent level."""
1694 """Keep track of the indent level."""
1687
1695
1688 #debugx('line')
1696 #debugx('line')
1689 #debugx('self.indent_current_nsp')
1697 #debugx('self.indent_current_nsp')
1690 if self.autoindent:
1698 if self.autoindent:
1691 if line:
1699 if line:
1692 inisp = num_ini_spaces(line)
1700 inisp = num_ini_spaces(line)
1693 if inisp < self.indent_current_nsp:
1701 if inisp < self.indent_current_nsp:
1694 self.indent_current_nsp = inisp
1702 self.indent_current_nsp = inisp
1695
1703
1696 if line[-1] == ':':
1704 if line[-1] == ':':
1697 self.indent_current_nsp += 4
1705 self.indent_current_nsp += 4
1698 elif dedent_re.match(line):
1706 elif dedent_re.match(line):
1699 self.indent_current_nsp -= 4
1707 self.indent_current_nsp -= 4
1700 else:
1708 else:
1701 self.indent_current_nsp = 0
1709 self.indent_current_nsp = 0
1702
1710
1703 def runlines(self,lines):
1711 def runlines(self,lines):
1704 """Run a string of one or more lines of source.
1712 """Run a string of one or more lines of source.
1705
1713
1706 This method is capable of running a string containing multiple source
1714 This method is capable of running a string containing multiple source
1707 lines, as if they had been entered at the IPython prompt. Since it
1715 lines, as if they had been entered at the IPython prompt. Since it
1708 exposes IPython's processing machinery, the given strings can contain
1716 exposes IPython's processing machinery, the given strings can contain
1709 magic calls (%magic), special shell access (!cmd), etc."""
1717 magic calls (%magic), special shell access (!cmd), etc."""
1710
1718
1711 # We must start with a clean buffer, in case this is run from an
1719 # We must start with a clean buffer, in case this is run from an
1712 # interactive IPython session (via a magic, for example).
1720 # interactive IPython session (via a magic, for example).
1713 self.resetbuffer()
1721 self.resetbuffer()
1714 lines = lines.split('\n')
1722 lines = lines.split('\n')
1715 more = 0
1723 more = 0
1716 for line in lines:
1724 for line in lines:
1717 # skip blank lines so we don't mess up the prompt counter, but do
1725 # skip blank lines so we don't mess up the prompt counter, but do
1718 # NOT skip even a blank line if we are in a code block (more is
1726 # NOT skip even a blank line if we are in a code block (more is
1719 # true)
1727 # true)
1720 if line or more:
1728 if line or more:
1721 more = self.push(self.prefilter(line,more))
1729 more = self.push(self.prefilter(line,more))
1722 # IPython's runsource returns None if there was an error
1730 # IPython's runsource returns None if there was an error
1723 # compiling the code. This allows us to stop processing right
1731 # compiling the code. This allows us to stop processing right
1724 # away, so the user gets the error message at the right place.
1732 # away, so the user gets the error message at the right place.
1725 if more is None:
1733 if more is None:
1726 break
1734 break
1727 # final newline in case the input didn't have it, so that the code
1735 # final newline in case the input didn't have it, so that the code
1728 # actually does get executed
1736 # actually does get executed
1729 if more:
1737 if more:
1730 self.push('\n')
1738 self.push('\n')
1731
1739
1732 def runsource(self, source, filename='<input>', symbol='single'):
1740 def runsource(self, source, filename='<input>', symbol='single'):
1733 """Compile and run some source in the interpreter.
1741 """Compile and run some source in the interpreter.
1734
1742
1735 Arguments are as for compile_command().
1743 Arguments are as for compile_command().
1736
1744
1737 One several things can happen:
1745 One several things can happen:
1738
1746
1739 1) The input is incorrect; compile_command() raised an
1747 1) The input is incorrect; compile_command() raised an
1740 exception (SyntaxError or OverflowError). A syntax traceback
1748 exception (SyntaxError or OverflowError). A syntax traceback
1741 will be printed by calling the showsyntaxerror() method.
1749 will be printed by calling the showsyntaxerror() method.
1742
1750
1743 2) The input is incomplete, and more input is required;
1751 2) The input is incomplete, and more input is required;
1744 compile_command() returned None. Nothing happens.
1752 compile_command() returned None. Nothing happens.
1745
1753
1746 3) The input is complete; compile_command() returned a code
1754 3) The input is complete; compile_command() returned a code
1747 object. The code is executed by calling self.runcode() (which
1755 object. The code is executed by calling self.runcode() (which
1748 also handles run-time exceptions, except for SystemExit).
1756 also handles run-time exceptions, except for SystemExit).
1749
1757
1750 The return value is:
1758 The return value is:
1751
1759
1752 - True in case 2
1760 - True in case 2
1753
1761
1754 - False in the other cases, unless an exception is raised, where
1762 - False in the other cases, unless an exception is raised, where
1755 None is returned instead. This can be used by external callers to
1763 None is returned instead. This can be used by external callers to
1756 know whether to continue feeding input or not.
1764 know whether to continue feeding input or not.
1757
1765
1758 The return value can be used to decide whether to use sys.ps1 or
1766 The return value can be used to decide whether to use sys.ps1 or
1759 sys.ps2 to prompt the next line."""
1767 sys.ps2 to prompt the next line."""
1760
1768
1761 try:
1769 try:
1762 code = self.compile(source,filename,symbol)
1770 code = self.compile(source,filename,symbol)
1763 except (OverflowError, SyntaxError, ValueError):
1771 except (OverflowError, SyntaxError, ValueError):
1764 # Case 1
1772 # Case 1
1765 self.showsyntaxerror(filename)
1773 self.showsyntaxerror(filename)
1766 return None
1774 return None
1767
1775
1768 if code is None:
1776 if code is None:
1769 # Case 2
1777 # Case 2
1770 return True
1778 return True
1771
1779
1772 # Case 3
1780 # Case 3
1773 # We store the code object so that threaded shells and
1781 # We store the code object so that threaded shells and
1774 # custom exception handlers can access all this info if needed.
1782 # custom exception handlers can access all this info if needed.
1775 # The source corresponding to this can be obtained from the
1783 # The source corresponding to this can be obtained from the
1776 # buffer attribute as '\n'.join(self.buffer).
1784 # buffer attribute as '\n'.join(self.buffer).
1777 self.code_to_run = code
1785 self.code_to_run = code
1778 # now actually execute the code object
1786 # now actually execute the code object
1779 if self.runcode(code) == 0:
1787 if self.runcode(code) == 0:
1780 return False
1788 return False
1781 else:
1789 else:
1782 return None
1790 return None
1783
1791
1784 def runcode(self,code_obj):
1792 def runcode(self,code_obj):
1785 """Execute a code object.
1793 """Execute a code object.
1786
1794
1787 When an exception occurs, self.showtraceback() is called to display a
1795 When an exception occurs, self.showtraceback() is called to display a
1788 traceback.
1796 traceback.
1789
1797
1790 Return value: a flag indicating whether the code to be run completed
1798 Return value: a flag indicating whether the code to be run completed
1791 successfully:
1799 successfully:
1792
1800
1793 - 0: successful execution.
1801 - 0: successful execution.
1794 - 1: an error occurred.
1802 - 1: an error occurred.
1795 """
1803 """
1796
1804
1797 # Set our own excepthook in case the user code tries to call it
1805 # Set our own excepthook in case the user code tries to call it
1798 # directly, so that the IPython crash handler doesn't get triggered
1806 # directly, so that the IPython crash handler doesn't get triggered
1799 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1807 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1800
1808
1801 # we save the original sys.excepthook in the instance, in case config
1809 # we save the original sys.excepthook in the instance, in case config
1802 # code (such as magics) needs access to it.
1810 # code (such as magics) needs access to it.
1803 self.sys_excepthook = old_excepthook
1811 self.sys_excepthook = old_excepthook
1804 outflag = 1 # happens in more places, so it's easier as default
1812 outflag = 1 # happens in more places, so it's easier as default
1805 try:
1813 try:
1806 try:
1814 try:
1807 # Embedded instances require separate global/local namespaces
1815 # Embedded instances require separate global/local namespaces
1808 # so they can see both the surrounding (local) namespace and
1816 # so they can see both the surrounding (local) namespace and
1809 # the module-level globals when called inside another function.
1817 # the module-level globals when called inside another function.
1810 if self.embedded:
1818 if self.embedded:
1811 exec code_obj in self.user_global_ns, self.user_ns
1819 exec code_obj in self.user_global_ns, self.user_ns
1812 # Normal (non-embedded) instances should only have a single
1820 # Normal (non-embedded) instances should only have a single
1813 # namespace for user code execution, otherwise functions won't
1821 # namespace for user code execution, otherwise functions won't
1814 # see interactive top-level globals.
1822 # see interactive top-level globals.
1815 else:
1823 else:
1816 exec code_obj in self.user_ns
1824 exec code_obj in self.user_ns
1817 finally:
1825 finally:
1818 # Reset our crash handler in place
1826 # Reset our crash handler in place
1819 sys.excepthook = old_excepthook
1827 sys.excepthook = old_excepthook
1820 except SystemExit:
1828 except SystemExit:
1821 self.resetbuffer()
1829 self.resetbuffer()
1822 self.showtraceback()
1830 self.showtraceback()
1823 warn("Type %exit or %quit to exit IPython "
1831 warn("Type %exit or %quit to exit IPython "
1824 "(%Exit or %Quit do so unconditionally).",level=1)
1832 "(%Exit or %Quit do so unconditionally).",level=1)
1825 except self.custom_exceptions:
1833 except self.custom_exceptions:
1826 etype,value,tb = sys.exc_info()
1834 etype,value,tb = sys.exc_info()
1827 self.CustomTB(etype,value,tb)
1835 self.CustomTB(etype,value,tb)
1828 except:
1836 except:
1829 self.showtraceback()
1837 self.showtraceback()
1830 else:
1838 else:
1831 outflag = 0
1839 outflag = 0
1832 if softspace(sys.stdout, 0):
1840 if softspace(sys.stdout, 0):
1833 print
1841 print
1834 # Flush out code object which has been run (and source)
1842 # Flush out code object which has been run (and source)
1835 self.code_to_run = None
1843 self.code_to_run = None
1836 return outflag
1844 return outflag
1837
1845
1838 def push(self, line):
1846 def push(self, line):
1839 """Push a line to the interpreter.
1847 """Push a line to the interpreter.
1840
1848
1841 The line should not have a trailing newline; it may have
1849 The line should not have a trailing newline; it may have
1842 internal newlines. The line is appended to a buffer and the
1850 internal newlines. The line is appended to a buffer and the
1843 interpreter's runsource() method is called with the
1851 interpreter's runsource() method is called with the
1844 concatenated contents of the buffer as source. If this
1852 concatenated contents of the buffer as source. If this
1845 indicates that the command was executed or invalid, the buffer
1853 indicates that the command was executed or invalid, the buffer
1846 is reset; otherwise, the command is incomplete, and the buffer
1854 is reset; otherwise, the command is incomplete, and the buffer
1847 is left as it was after the line was appended. The return
1855 is left as it was after the line was appended. The return
1848 value is 1 if more input is required, 0 if the line was dealt
1856 value is 1 if more input is required, 0 if the line was dealt
1849 with in some way (this is the same as runsource()).
1857 with in some way (this is the same as runsource()).
1850 """
1858 """
1851
1859
1852 # autoindent management should be done here, and not in the
1860 # autoindent management should be done here, and not in the
1853 # interactive loop, since that one is only seen by keyboard input. We
1861 # interactive loop, since that one is only seen by keyboard input. We
1854 # need this done correctly even for code run via runlines (which uses
1862 # need this done correctly even for code run via runlines (which uses
1855 # push).
1863 # push).
1856
1864
1857 #print 'push line: <%s>' % line # dbg
1865 #print 'push line: <%s>' % line # dbg
1858 for subline in line.splitlines():
1866 for subline in line.splitlines():
1859 self.autoindent_update(subline)
1867 self.autoindent_update(subline)
1860 self.buffer.append(line)
1868 self.buffer.append(line)
1861 more = self.runsource('\n'.join(self.buffer), self.filename)
1869 more = self.runsource('\n'.join(self.buffer), self.filename)
1862 if not more:
1870 if not more:
1863 self.resetbuffer()
1871 self.resetbuffer()
1864 return more
1872 return more
1865
1873
1866 def resetbuffer(self):
1874 def resetbuffer(self):
1867 """Reset the input buffer."""
1875 """Reset the input buffer."""
1868 self.buffer[:] = []
1876 self.buffer[:] = []
1869
1877
1870 def raw_input(self,prompt='',continue_prompt=False):
1878 def raw_input(self,prompt='',continue_prompt=False):
1871 """Write a prompt and read a line.
1879 """Write a prompt and read a line.
1872
1880
1873 The returned line does not include the trailing newline.
1881 The returned line does not include the trailing newline.
1874 When the user enters the EOF key sequence, EOFError is raised.
1882 When the user enters the EOF key sequence, EOFError is raised.
1875
1883
1876 Optional inputs:
1884 Optional inputs:
1877
1885
1878 - prompt(''): a string to be printed to prompt the user.
1886 - prompt(''): a string to be printed to prompt the user.
1879
1887
1880 - continue_prompt(False): whether this line is the first one or a
1888 - continue_prompt(False): whether this line is the first one or a
1881 continuation in a sequence of inputs.
1889 continuation in a sequence of inputs.
1882 """
1890 """
1883
1891
1884 try:
1892 try:
1885 line = raw_input_original(prompt)
1893 line = raw_input_original(prompt)
1886 except ValueError:
1894 except ValueError:
1887 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1895 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1888 self.exit_now = True
1896 self.exit_now = True
1889 return ""
1897 return ""
1890
1898
1891
1899
1892 # Try to be reasonably smart about not re-indenting pasted input more
1900 # Try to be reasonably smart about not re-indenting pasted input more
1893 # than necessary. We do this by trimming out the auto-indent initial
1901 # than necessary. We do this by trimming out the auto-indent initial
1894 # spaces, if the user's actual input started itself with whitespace.
1902 # spaces, if the user's actual input started itself with whitespace.
1895 #debugx('self.buffer[-1]')
1903 #debugx('self.buffer[-1]')
1896
1904
1897 if self.autoindent:
1905 if self.autoindent:
1898 if num_ini_spaces(line) > self.indent_current_nsp:
1906 if num_ini_spaces(line) > self.indent_current_nsp:
1899 line = line[self.indent_current_nsp:]
1907 line = line[self.indent_current_nsp:]
1900 self.indent_current_nsp = 0
1908 self.indent_current_nsp = 0
1901
1909
1902 # store the unfiltered input before the user has any chance to modify
1910 # store the unfiltered input before the user has any chance to modify
1903 # it.
1911 # it.
1904 if line.strip():
1912 if line.strip():
1905 if continue_prompt:
1913 if continue_prompt:
1906 self.input_hist_raw[-1] += '%s\n' % line
1914 self.input_hist_raw[-1] += '%s\n' % line
1907 if self.has_readline: # and some config option is set?
1915 if self.has_readline: # and some config option is set?
1908 try:
1916 try:
1909 histlen = self.readline.get_current_history_length()
1917 histlen = self.readline.get_current_history_length()
1910 newhist = self.input_hist_raw[-1].rstrip()
1918 newhist = self.input_hist_raw[-1].rstrip()
1911 self.readline.remove_history_item(histlen-1)
1919 self.readline.remove_history_item(histlen-1)
1912 self.readline.replace_history_item(histlen-2,newhist)
1920 self.readline.replace_history_item(histlen-2,newhist)
1913 except AttributeError:
1921 except AttributeError:
1914 pass # re{move,place}_history_item are new in 2.4.
1922 pass # re{move,place}_history_item are new in 2.4.
1915 else:
1923 else:
1916 self.input_hist_raw.append('%s\n' % line)
1924 self.input_hist_raw.append('%s\n' % line)
1917
1925
1918 try:
1926 try:
1919 lineout = self.prefilter(line,continue_prompt)
1927 lineout = self.prefilter(line,continue_prompt)
1920 except:
1928 except:
1921 # blanket except, in case a user-defined prefilter crashes, so it
1929 # blanket except, in case a user-defined prefilter crashes, so it
1922 # can't take all of ipython with it.
1930 # can't take all of ipython with it.
1923 self.showtraceback()
1931 self.showtraceback()
1924 return ''
1932 return ''
1925 else:
1933 else:
1926 return lineout
1934 return lineout
1927
1935
1928 def split_user_input(self,line):
1936 def split_user_input(self,line):
1929 """Split user input into pre-char, function part and rest."""
1937 """Split user input into pre-char, function part and rest."""
1930
1938
1931 lsplit = self.line_split.match(line)
1939 lsplit = self.line_split.match(line)
1932 if lsplit is None: # no regexp match returns None
1940 if lsplit is None: # no regexp match returns None
1933 try:
1941 try:
1934 iFun,theRest = line.split(None,1)
1942 iFun,theRest = line.split(None,1)
1935 except ValueError:
1943 except ValueError:
1936 iFun,theRest = line,''
1944 iFun,theRest = line,''
1937 pre = re.match('^(\s*)(.*)',line).groups()[0]
1945 pre = re.match('^(\s*)(.*)',line).groups()[0]
1938 else:
1946 else:
1939 pre,iFun,theRest = lsplit.groups()
1947 pre,iFun,theRest = lsplit.groups()
1940
1948
1941 #print 'line:<%s>' % line # dbg
1949 #print 'line:<%s>' % line # dbg
1942 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1950 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1943 return pre,iFun.strip(),theRest
1951 return pre,iFun.strip(),theRest
1944
1952
1945 def _prefilter(self, line, continue_prompt):
1953 def _prefilter(self, line, continue_prompt):
1946 """Calls different preprocessors, depending on the form of line."""
1954 """Calls different preprocessors, depending on the form of line."""
1947
1955
1948 # All handlers *must* return a value, even if it's blank ('').
1956 # All handlers *must* return a value, even if it's blank ('').
1949
1957
1950 # Lines are NOT logged here. Handlers should process the line as
1958 # Lines are NOT logged here. Handlers should process the line as
1951 # needed, update the cache AND log it (so that the input cache array
1959 # needed, update the cache AND log it (so that the input cache array
1952 # stays synced).
1960 # stays synced).
1953
1961
1954 # This function is _very_ delicate, and since it's also the one which
1962 # This function is _very_ delicate, and since it's also the one which
1955 # determines IPython's response to user input, it must be as efficient
1963 # determines IPython's response to user input, it must be as efficient
1956 # as possible. For this reason it has _many_ returns in it, trying
1964 # as possible. For this reason it has _many_ returns in it, trying
1957 # always to exit as quickly as it can figure out what it needs to do.
1965 # always to exit as quickly as it can figure out what it needs to do.
1958
1966
1959 # This function is the main responsible for maintaining IPython's
1967 # This function is the main responsible for maintaining IPython's
1960 # behavior respectful of Python's semantics. So be _very_ careful if
1968 # behavior respectful of Python's semantics. So be _very_ careful if
1961 # making changes to anything here.
1969 # making changes to anything here.
1962
1970
1963 #.....................................................................
1971 #.....................................................................
1964 # Code begins
1972 # Code begins
1965
1973
1966 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1974 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1967
1975
1968 # save the line away in case we crash, so the post-mortem handler can
1976 # save the line away in case we crash, so the post-mortem handler can
1969 # record it
1977 # record it
1970 self._last_input_line = line
1978 self._last_input_line = line
1971
1979
1972 #print '***line: <%s>' % line # dbg
1980 #print '***line: <%s>' % line # dbg
1973
1981
1974 # the input history needs to track even empty lines
1982 # the input history needs to track even empty lines
1975 stripped = line.strip()
1983 stripped = line.strip()
1976
1984
1977 if not stripped:
1985 if not stripped:
1978 if not continue_prompt:
1986 if not continue_prompt:
1979 self.outputcache.prompt_count -= 1
1987 self.outputcache.prompt_count -= 1
1980 return self.handle_normal(line,continue_prompt)
1988 return self.handle_normal(line,continue_prompt)
1981 #return self.handle_normal('',continue_prompt)
1989 #return self.handle_normal('',continue_prompt)
1982
1990
1983 # print '***cont',continue_prompt # dbg
1991 # print '***cont',continue_prompt # dbg
1984 # special handlers are only allowed for single line statements
1992 # special handlers are only allowed for single line statements
1985 if continue_prompt and not self.rc.multi_line_specials:
1993 if continue_prompt and not self.rc.multi_line_specials:
1986 return self.handle_normal(line,continue_prompt)
1994 return self.handle_normal(line,continue_prompt)
1987
1995
1988
1996
1989 # For the rest, we need the structure of the input
1997 # For the rest, we need the structure of the input
1990 pre,iFun,theRest = self.split_user_input(line)
1998 pre,iFun,theRest = self.split_user_input(line)
1991
1999
1992 # See whether any pre-existing handler can take care of it
2000 # See whether any pre-existing handler can take care of it
1993
2001
1994 rewritten = self.hooks.input_prefilter(stripped)
2002 rewritten = self.hooks.input_prefilter(stripped)
1995 if rewritten != stripped: # ok, some prefilter did something
2003 if rewritten != stripped: # ok, some prefilter did something
1996 rewritten = pre + rewritten # add indentation
2004 rewritten = pre + rewritten # add indentation
1997 return self.handle_normal(rewritten)
2005 return self.handle_normal(rewritten)
1998
2006
1999 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2007 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2000
2008
2001 # First check for explicit escapes in the last/first character
2009 # First check for explicit escapes in the last/first character
2002 handler = None
2010 handler = None
2003 if line[-1] == self.ESC_HELP:
2011 if line[-1] == self.ESC_HELP:
2004 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2012 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2005 if handler is None:
2013 if handler is None:
2006 # look at the first character of iFun, NOT of line, so we skip
2014 # look at the first character of iFun, NOT of line, so we skip
2007 # leading whitespace in multiline input
2015 # leading whitespace in multiline input
2008 handler = self.esc_handlers.get(iFun[0:1])
2016 handler = self.esc_handlers.get(iFun[0:1])
2009 if handler is not None:
2017 if handler is not None:
2010 return handler(line,continue_prompt,pre,iFun,theRest)
2018 return handler(line,continue_prompt,pre,iFun,theRest)
2011 # Emacs ipython-mode tags certain input lines
2019 # Emacs ipython-mode tags certain input lines
2012 if line.endswith('# PYTHON-MODE'):
2020 if line.endswith('# PYTHON-MODE'):
2013 return self.handle_emacs(line,continue_prompt)
2021 return self.handle_emacs(line,continue_prompt)
2014
2022
2015 # Next, check if we can automatically execute this thing
2023 # Next, check if we can automatically execute this thing
2016
2024
2017 # Allow ! in multi-line statements if multi_line_specials is on:
2025 # Allow ! in multi-line statements if multi_line_specials is on:
2018 if continue_prompt and self.rc.multi_line_specials and \
2026 if continue_prompt and self.rc.multi_line_specials and \
2019 iFun.startswith(self.ESC_SHELL):
2027 iFun.startswith(self.ESC_SHELL):
2020 return self.handle_shell_escape(line,continue_prompt,
2028 return self.handle_shell_escape(line,continue_prompt,
2021 pre=pre,iFun=iFun,
2029 pre=pre,iFun=iFun,
2022 theRest=theRest)
2030 theRest=theRest)
2023
2031
2024 # Let's try to find if the input line is a magic fn
2032 # Let's try to find if the input line is a magic fn
2025 oinfo = None
2033 oinfo = None
2026 if hasattr(self,'magic_'+iFun):
2034 if hasattr(self,'magic_'+iFun):
2027 # WARNING: _ofind uses getattr(), so it can consume generators and
2035 # WARNING: _ofind uses getattr(), so it can consume generators and
2028 # cause other side effects.
2036 # cause other side effects.
2029 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2037 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2030 if oinfo['ismagic']:
2038 if oinfo['ismagic']:
2031 # Be careful not to call magics when a variable assignment is
2039 # Be careful not to call magics when a variable assignment is
2032 # being made (ls='hi', for example)
2040 # being made (ls='hi', for example)
2033 if self.rc.automagic and \
2041 if self.rc.automagic and \
2034 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2042 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2035 (self.rc.multi_line_specials or not continue_prompt):
2043 (self.rc.multi_line_specials or not continue_prompt):
2036 return self.handle_magic(line,continue_prompt,
2044 return self.handle_magic(line,continue_prompt,
2037 pre,iFun,theRest)
2045 pre,iFun,theRest)
2038 else:
2046 else:
2039 return self.handle_normal(line,continue_prompt)
2047 return self.handle_normal(line,continue_prompt)
2040
2048
2041 # If the rest of the line begins with an (in)equality, assginment or
2049 # If the rest of the line begins with an (in)equality, assginment or
2042 # function call, we should not call _ofind but simply execute it.
2050 # function call, we should not call _ofind but simply execute it.
2043 # This avoids spurious geattr() accesses on objects upon assignment.
2051 # This avoids spurious geattr() accesses on objects upon assignment.
2044 #
2052 #
2045 # It also allows users to assign to either alias or magic names true
2053 # It also allows users to assign to either alias or magic names true
2046 # python variables (the magic/alias systems always take second seat to
2054 # python variables (the magic/alias systems always take second seat to
2047 # true python code).
2055 # true python code).
2048 if theRest and theRest[0] in '!=()':
2056 if theRest and theRest[0] in '!=()':
2049 return self.handle_normal(line,continue_prompt)
2057 return self.handle_normal(line,continue_prompt)
2050
2058
2051 if oinfo is None:
2059 if oinfo is None:
2052 # let's try to ensure that _oinfo is ONLY called when autocall is
2060 # let's try to ensure that _oinfo is ONLY called when autocall is
2053 # on. Since it has inevitable potential side effects, at least
2061 # on. Since it has inevitable potential side effects, at least
2054 # having autocall off should be a guarantee to the user that no
2062 # having autocall off should be a guarantee to the user that no
2055 # weird things will happen.
2063 # weird things will happen.
2056
2064
2057 if self.rc.autocall:
2065 if self.rc.autocall:
2058 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2066 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2059 else:
2067 else:
2060 # in this case, all that's left is either an alias or
2068 # in this case, all that's left is either an alias or
2061 # processing the line normally.
2069 # processing the line normally.
2062 if iFun in self.alias_table:
2070 if iFun in self.alias_table:
2063 # if autocall is off, by not running _ofind we won't know
2071 # if autocall is off, by not running _ofind we won't know
2064 # whether the given name may also exist in one of the
2072 # whether the given name may also exist in one of the
2065 # user's namespace. At this point, it's best to do a
2073 # user's namespace. At this point, it's best to do a
2066 # quick check just to be sure that we don't let aliases
2074 # quick check just to be sure that we don't let aliases
2067 # shadow variables.
2075 # shadow variables.
2068 head = iFun.split('.',1)[0]
2076 head = iFun.split('.',1)[0]
2069 if head in self.user_ns or head in self.internal_ns \
2077 if head in self.user_ns or head in self.internal_ns \
2070 or head in __builtin__.__dict__:
2078 or head in __builtin__.__dict__:
2071 return self.handle_normal(line,continue_prompt)
2079 return self.handle_normal(line,continue_prompt)
2072 else:
2080 else:
2073 return self.handle_alias(line,continue_prompt,
2081 return self.handle_alias(line,continue_prompt,
2074 pre,iFun,theRest)
2082 pre,iFun,theRest)
2075
2083
2076 else:
2084 else:
2077 return self.handle_normal(line,continue_prompt)
2085 return self.handle_normal(line,continue_prompt)
2078
2086
2079 if not oinfo['found']:
2087 if not oinfo['found']:
2080 return self.handle_normal(line,continue_prompt)
2088 return self.handle_normal(line,continue_prompt)
2081 else:
2089 else:
2082 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2090 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2083 if oinfo['isalias']:
2091 if oinfo['isalias']:
2084 return self.handle_alias(line,continue_prompt,
2092 return self.handle_alias(line,continue_prompt,
2085 pre,iFun,theRest)
2093 pre,iFun,theRest)
2086
2094
2087 if (self.rc.autocall
2095 if (self.rc.autocall
2088 and
2096 and
2089 (
2097 (
2090 #only consider exclusion re if not "," or ";" autoquoting
2098 #only consider exclusion re if not "," or ";" autoquoting
2091 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2099 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2092 or pre == self.ESC_PAREN) or
2100 or pre == self.ESC_PAREN) or
2093 (not self.re_exclude_auto.match(theRest)))
2101 (not self.re_exclude_auto.match(theRest)))
2094 and
2102 and
2095 self.re_fun_name.match(iFun) and
2103 self.re_fun_name.match(iFun) and
2096 callable(oinfo['obj'])) :
2104 callable(oinfo['obj'])) :
2097 #print 'going auto' # dbg
2105 #print 'going auto' # dbg
2098 return self.handle_auto(line,continue_prompt,
2106 return self.handle_auto(line,continue_prompt,
2099 pre,iFun,theRest,oinfo['obj'])
2107 pre,iFun,theRest,oinfo['obj'])
2100 else:
2108 else:
2101 #print 'was callable?', callable(oinfo['obj']) # dbg
2109 #print 'was callable?', callable(oinfo['obj']) # dbg
2102 return self.handle_normal(line,continue_prompt)
2110 return self.handle_normal(line,continue_prompt)
2103
2111
2104 # If we get here, we have a normal Python line. Log and return.
2112 # If we get here, we have a normal Python line. Log and return.
2105 return self.handle_normal(line,continue_prompt)
2113 return self.handle_normal(line,continue_prompt)
2106
2114
2107 def _prefilter_dumb(self, line, continue_prompt):
2115 def _prefilter_dumb(self, line, continue_prompt):
2108 """simple prefilter function, for debugging"""
2116 """simple prefilter function, for debugging"""
2109 return self.handle_normal(line,continue_prompt)
2117 return self.handle_normal(line,continue_prompt)
2110
2118
2111
2119
2112 def multiline_prefilter(self, line, continue_prompt):
2120 def multiline_prefilter(self, line, continue_prompt):
2113 """ Run _prefilter for each line of input
2121 """ Run _prefilter for each line of input
2114
2122
2115 Covers cases where there are multiple lines in the user entry,
2123 Covers cases where there are multiple lines in the user entry,
2116 which is the case when the user goes back to a multiline history
2124 which is the case when the user goes back to a multiline history
2117 entry and presses enter.
2125 entry and presses enter.
2118
2126
2119 """
2127 """
2120 out = []
2128 out = []
2121 for l in line.rstrip('\n').split('\n'):
2129 for l in line.rstrip('\n').split('\n'):
2122 out.append(self._prefilter(l, continue_prompt))
2130 out.append(self._prefilter(l, continue_prompt))
2123 return '\n'.join(out)
2131 return '\n'.join(out)
2124
2132
2125 # Set the default prefilter() function (this can be user-overridden)
2133 # Set the default prefilter() function (this can be user-overridden)
2126 prefilter = multiline_prefilter
2134 prefilter = multiline_prefilter
2127
2135
2128 def handle_normal(self,line,continue_prompt=None,
2136 def handle_normal(self,line,continue_prompt=None,
2129 pre=None,iFun=None,theRest=None):
2137 pre=None,iFun=None,theRest=None):
2130 """Handle normal input lines. Use as a template for handlers."""
2138 """Handle normal input lines. Use as a template for handlers."""
2131
2139
2132 # With autoindent on, we need some way to exit the input loop, and I
2140 # With autoindent on, we need some way to exit the input loop, and I
2133 # don't want to force the user to have to backspace all the way to
2141 # don't want to force the user to have to backspace all the way to
2134 # clear the line. The rule will be in this case, that either two
2142 # clear the line. The rule will be in this case, that either two
2135 # lines of pure whitespace in a row, or a line of pure whitespace but
2143 # lines of pure whitespace in a row, or a line of pure whitespace but
2136 # of a size different to the indent level, will exit the input loop.
2144 # of a size different to the indent level, will exit the input loop.
2137
2145
2138 if (continue_prompt and self.autoindent and line.isspace() and
2146 if (continue_prompt and self.autoindent and line.isspace() and
2139 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2147 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2140 (self.buffer[-1]).isspace() )):
2148 (self.buffer[-1]).isspace() )):
2141 line = ''
2149 line = ''
2142
2150
2143 self.log(line,line,continue_prompt)
2151 self.log(line,line,continue_prompt)
2144 return line
2152 return line
2145
2153
2146 def handle_alias(self,line,continue_prompt=None,
2154 def handle_alias(self,line,continue_prompt=None,
2147 pre=None,iFun=None,theRest=None):
2155 pre=None,iFun=None,theRest=None):
2148 """Handle alias input lines. """
2156 """Handle alias input lines. """
2149
2157
2150 # pre is needed, because it carries the leading whitespace. Otherwise
2158 # pre is needed, because it carries the leading whitespace. Otherwise
2151 # aliases won't work in indented sections.
2159 # aliases won't work in indented sections.
2152 transformed = self.expand_aliases(iFun, theRest)
2160 transformed = self.expand_aliases(iFun, theRest)
2153 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2161 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2154 self.log(line,line_out,continue_prompt)
2162 self.log(line,line_out,continue_prompt)
2155 #print 'line out:',line_out # dbg
2163 #print 'line out:',line_out # dbg
2156 return line_out
2164 return line_out
2157
2165
2158 def handle_shell_escape(self, line, continue_prompt=None,
2166 def handle_shell_escape(self, line, continue_prompt=None,
2159 pre=None,iFun=None,theRest=None):
2167 pre=None,iFun=None,theRest=None):
2160 """Execute the line in a shell, empty return value"""
2168 """Execute the line in a shell, empty return value"""
2161
2169
2162 #print 'line in :', `line` # dbg
2170 #print 'line in :', `line` # dbg
2163 # Example of a special handler. Others follow a similar pattern.
2171 # Example of a special handler. Others follow a similar pattern.
2164 if line.lstrip().startswith('!!'):
2172 if line.lstrip().startswith('!!'):
2165 # rewrite iFun/theRest to properly hold the call to %sx and
2173 # rewrite iFun/theRest to properly hold the call to %sx and
2166 # the actual command to be executed, so handle_magic can work
2174 # the actual command to be executed, so handle_magic can work
2167 # correctly
2175 # correctly
2168 theRest = '%s %s' % (iFun[2:],theRest)
2176 theRest = '%s %s' % (iFun[2:],theRest)
2169 iFun = 'sx'
2177 iFun = 'sx'
2170 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2178 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2171 line.lstrip()[2:]),
2179 line.lstrip()[2:]),
2172 continue_prompt,pre,iFun,theRest)
2180 continue_prompt,pre,iFun,theRest)
2173 else:
2181 else:
2174 cmd=line.lstrip().lstrip('!')
2182 cmd=line.lstrip().lstrip('!')
2175 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2183 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2176 # update cache/log and return
2184 # update cache/log and return
2177 self.log(line,line_out,continue_prompt)
2185 self.log(line,line_out,continue_prompt)
2178 return line_out
2186 return line_out
2179
2187
2180 def handle_magic(self, line, continue_prompt=None,
2188 def handle_magic(self, line, continue_prompt=None,
2181 pre=None,iFun=None,theRest=None):
2189 pre=None,iFun=None,theRest=None):
2182 """Execute magic functions."""
2190 """Execute magic functions."""
2183
2191
2184
2192
2185 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2193 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2186 self.log(line,cmd,continue_prompt)
2194 self.log(line,cmd,continue_prompt)
2187 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2195 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2188 return cmd
2196 return cmd
2189
2197
2190 def handle_auto(self, line, continue_prompt=None,
2198 def handle_auto(self, line, continue_prompt=None,
2191 pre=None,iFun=None,theRest=None,obj=None):
2199 pre=None,iFun=None,theRest=None,obj=None):
2192 """Hande lines which can be auto-executed, quoting if requested."""
2200 """Hande lines which can be auto-executed, quoting if requested."""
2193
2201
2194 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2202 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2195
2203
2196 # This should only be active for single-line input!
2204 # This should only be active for single-line input!
2197 if continue_prompt:
2205 if continue_prompt:
2198 self.log(line,line,continue_prompt)
2206 self.log(line,line,continue_prompt)
2199 return line
2207 return line
2200
2208
2201 auto_rewrite = True
2209 auto_rewrite = True
2202
2210
2203 if pre == self.ESC_QUOTE:
2211 if pre == self.ESC_QUOTE:
2204 # Auto-quote splitting on whitespace
2212 # Auto-quote splitting on whitespace
2205 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2213 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2206 elif pre == self.ESC_QUOTE2:
2214 elif pre == self.ESC_QUOTE2:
2207 # Auto-quote whole string
2215 # Auto-quote whole string
2208 newcmd = '%s("%s")' % (iFun,theRest)
2216 newcmd = '%s("%s")' % (iFun,theRest)
2209 elif pre == self.ESC_PAREN:
2217 elif pre == self.ESC_PAREN:
2210 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2218 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2211 else:
2219 else:
2212 # Auto-paren.
2220 # Auto-paren.
2213 # We only apply it to argument-less calls if the autocall
2221 # We only apply it to argument-less calls if the autocall
2214 # parameter is set to 2. We only need to check that autocall is <
2222 # parameter is set to 2. We only need to check that autocall is <
2215 # 2, since this function isn't called unless it's at least 1.
2223 # 2, since this function isn't called unless it's at least 1.
2216 if not theRest and (self.rc.autocall < 2):
2224 if not theRest and (self.rc.autocall < 2):
2217 newcmd = '%s %s' % (iFun,theRest)
2225 newcmd = '%s %s' % (iFun,theRest)
2218 auto_rewrite = False
2226 auto_rewrite = False
2219 else:
2227 else:
2220 if theRest.startswith('['):
2228 if theRest.startswith('['):
2221 if hasattr(obj,'__getitem__'):
2229 if hasattr(obj,'__getitem__'):
2222 # Don't autocall in this case: item access for an object
2230 # Don't autocall in this case: item access for an object
2223 # which is BOTH callable and implements __getitem__.
2231 # which is BOTH callable and implements __getitem__.
2224 newcmd = '%s %s' % (iFun,theRest)
2232 newcmd = '%s %s' % (iFun,theRest)
2225 auto_rewrite = False
2233 auto_rewrite = False
2226 else:
2234 else:
2227 # if the object doesn't support [] access, go ahead and
2235 # if the object doesn't support [] access, go ahead and
2228 # autocall
2236 # autocall
2229 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2237 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2230 elif theRest.endswith(';'):
2238 elif theRest.endswith(';'):
2231 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2239 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2232 else:
2240 else:
2233 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2241 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2234
2242
2235 if auto_rewrite:
2243 if auto_rewrite:
2236 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2244 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2237 # log what is now valid Python, not the actual user input (without the
2245 # log what is now valid Python, not the actual user input (without the
2238 # final newline)
2246 # final newline)
2239 self.log(line,newcmd,continue_prompt)
2247 self.log(line,newcmd,continue_prompt)
2240 return newcmd
2248 return newcmd
2241
2249
2242 def handle_help(self, line, continue_prompt=None,
2250 def handle_help(self, line, continue_prompt=None,
2243 pre=None,iFun=None,theRest=None):
2251 pre=None,iFun=None,theRest=None):
2244 """Try to get some help for the object.
2252 """Try to get some help for the object.
2245
2253
2246 obj? or ?obj -> basic information.
2254 obj? or ?obj -> basic information.
2247 obj?? or ??obj -> more details.
2255 obj?? or ??obj -> more details.
2248 """
2256 """
2249
2257
2250 # We need to make sure that we don't process lines which would be
2258 # We need to make sure that we don't process lines which would be
2251 # otherwise valid python, such as "x=1 # what?"
2259 # otherwise valid python, such as "x=1 # what?"
2252 try:
2260 try:
2253 codeop.compile_command(line)
2261 codeop.compile_command(line)
2254 except SyntaxError:
2262 except SyntaxError:
2255 # We should only handle as help stuff which is NOT valid syntax
2263 # We should only handle as help stuff which is NOT valid syntax
2256 if line[0]==self.ESC_HELP:
2264 if line[0]==self.ESC_HELP:
2257 line = line[1:]
2265 line = line[1:]
2258 elif line[-1]==self.ESC_HELP:
2266 elif line[-1]==self.ESC_HELP:
2259 line = line[:-1]
2267 line = line[:-1]
2260 self.log(line,'#?'+line,continue_prompt)
2268 self.log(line,'#?'+line,continue_prompt)
2261 if line:
2269 if line:
2262 self.magic_pinfo(line)
2270 self.magic_pinfo(line)
2263 else:
2271 else:
2264 page(self.usage,screen_lines=self.rc.screen_length)
2272 page(self.usage,screen_lines=self.rc.screen_length)
2265 return '' # Empty string is needed here!
2273 return '' # Empty string is needed here!
2266 except:
2274 except:
2267 # Pass any other exceptions through to the normal handler
2275 # Pass any other exceptions through to the normal handler
2268 return self.handle_normal(line,continue_prompt)
2276 return self.handle_normal(line,continue_prompt)
2269 else:
2277 else:
2270 # If the code compiles ok, we should handle it normally
2278 # If the code compiles ok, we should handle it normally
2271 return self.handle_normal(line,continue_prompt)
2279 return self.handle_normal(line,continue_prompt)
2272
2280
2273 def getapi(self):
2281 def getapi(self):
2274 """ Get an IPApi object for this shell instance
2282 """ Get an IPApi object for this shell instance
2275
2283
2276 Getting an IPApi object is always preferable to accessing the shell
2284 Getting an IPApi object is always preferable to accessing the shell
2277 directly, but this holds true especially for extensions.
2285 directly, but this holds true especially for extensions.
2278
2286
2279 It should always be possible to implement an extension with IPApi
2287 It should always be possible to implement an extension with IPApi
2280 alone. If not, contact maintainer to request an addition.
2288 alone. If not, contact maintainer to request an addition.
2281
2289
2282 """
2290 """
2283 return self.api
2291 return self.api
2284
2292
2285 def handle_emacs(self,line,continue_prompt=None,
2293 def handle_emacs(self,line,continue_prompt=None,
2286 pre=None,iFun=None,theRest=None):
2294 pre=None,iFun=None,theRest=None):
2287 """Handle input lines marked by python-mode."""
2295 """Handle input lines marked by python-mode."""
2288
2296
2289 # Currently, nothing is done. Later more functionality can be added
2297 # Currently, nothing is done. Later more functionality can be added
2290 # here if needed.
2298 # here if needed.
2291
2299
2292 # The input cache shouldn't be updated
2300 # The input cache shouldn't be updated
2293
2301
2294 return line
2302 return line
2295
2303
2296 def mktempfile(self,data=None):
2304 def mktempfile(self,data=None):
2297 """Make a new tempfile and return its filename.
2305 """Make a new tempfile and return its filename.
2298
2306
2299 This makes a call to tempfile.mktemp, but it registers the created
2307 This makes a call to tempfile.mktemp, but it registers the created
2300 filename internally so ipython cleans it up at exit time.
2308 filename internally so ipython cleans it up at exit time.
2301
2309
2302 Optional inputs:
2310 Optional inputs:
2303
2311
2304 - data(None): if data is given, it gets written out to the temp file
2312 - data(None): if data is given, it gets written out to the temp file
2305 immediately, and the file is closed again."""
2313 immediately, and the file is closed again."""
2306
2314
2307 filename = tempfile.mktemp('.py','ipython_edit_')
2315 filename = tempfile.mktemp('.py','ipython_edit_')
2308 self.tempfiles.append(filename)
2316 self.tempfiles.append(filename)
2309
2317
2310 if data:
2318 if data:
2311 tmp_file = open(filename,'w')
2319 tmp_file = open(filename,'w')
2312 tmp_file.write(data)
2320 tmp_file.write(data)
2313 tmp_file.close()
2321 tmp_file.close()
2314 return filename
2322 return filename
2315
2323
2316 def write(self,data):
2324 def write(self,data):
2317 """Write a string to the default output"""
2325 """Write a string to the default output"""
2318 Term.cout.write(data)
2326 Term.cout.write(data)
2319
2327
2320 def write_err(self,data):
2328 def write_err(self,data):
2321 """Write a string to the default error output"""
2329 """Write a string to the default error output"""
2322 Term.cerr.write(data)
2330 Term.cerr.write(data)
2323
2331
2324 def exit(self):
2332 def exit(self):
2325 """Handle interactive exit.
2333 """Handle interactive exit.
2326
2334
2327 This method sets the exit_now attribute."""
2335 This method sets the exit_now attribute."""
2328
2336
2329 if self.rc.confirm_exit:
2337 if self.rc.confirm_exit:
2330 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2338 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2331 self.exit_now = True
2339 self.exit_now = True
2332 else:
2340 else:
2333 self.exit_now = True
2341 self.exit_now = True
2334
2342
2335 def safe_execfile(self,fname,*where,**kw):
2343 def safe_execfile(self,fname,*where,**kw):
2336 fname = os.path.expanduser(fname)
2344 fname = os.path.expanduser(fname)
2337
2345
2338 # find things also in current directory
2346 # find things also in current directory
2339 dname = os.path.dirname(fname)
2347 dname = os.path.dirname(fname)
2340 if not sys.path.count(dname):
2348 if not sys.path.count(dname):
2341 sys.path.append(dname)
2349 sys.path.append(dname)
2342
2350
2343 try:
2351 try:
2344 xfile = open(fname)
2352 xfile = open(fname)
2345 except:
2353 except:
2346 print >> Term.cerr, \
2354 print >> Term.cerr, \
2347 'Could not open file <%s> for safe execution.' % fname
2355 'Could not open file <%s> for safe execution.' % fname
2348 return None
2356 return None
2349
2357
2350 kw.setdefault('islog',0)
2358 kw.setdefault('islog',0)
2351 kw.setdefault('quiet',1)
2359 kw.setdefault('quiet',1)
2352 kw.setdefault('exit_ignore',0)
2360 kw.setdefault('exit_ignore',0)
2353 first = xfile.readline()
2361 first = xfile.readline()
2354 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2362 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2355 xfile.close()
2363 xfile.close()
2356 # line by line execution
2364 # line by line execution
2357 if first.startswith(loghead) or kw['islog']:
2365 if first.startswith(loghead) or kw['islog']:
2358 print 'Loading log file <%s> one line at a time...' % fname
2366 print 'Loading log file <%s> one line at a time...' % fname
2359 if kw['quiet']:
2367 if kw['quiet']:
2360 stdout_save = sys.stdout
2368 stdout_save = sys.stdout
2361 sys.stdout = StringIO.StringIO()
2369 sys.stdout = StringIO.StringIO()
2362 try:
2370 try:
2363 globs,locs = where[0:2]
2371 globs,locs = where[0:2]
2364 except:
2372 except:
2365 try:
2373 try:
2366 globs = locs = where[0]
2374 globs = locs = where[0]
2367 except:
2375 except:
2368 globs = locs = globals()
2376 globs = locs = globals()
2369 badblocks = []
2377 badblocks = []
2370
2378
2371 # we also need to identify indented blocks of code when replaying
2379 # we also need to identify indented blocks of code when replaying
2372 # logs and put them together before passing them to an exec
2380 # logs and put them together before passing them to an exec
2373 # statement. This takes a bit of regexp and look-ahead work in the
2381 # statement. This takes a bit of regexp and look-ahead work in the
2374 # file. It's easiest if we swallow the whole thing in memory
2382 # file. It's easiest if we swallow the whole thing in memory
2375 # first, and manually walk through the lines list moving the
2383 # first, and manually walk through the lines list moving the
2376 # counter ourselves.
2384 # counter ourselves.
2377 indent_re = re.compile('\s+\S')
2385 indent_re = re.compile('\s+\S')
2378 xfile = open(fname)
2386 xfile = open(fname)
2379 filelines = xfile.readlines()
2387 filelines = xfile.readlines()
2380 xfile.close()
2388 xfile.close()
2381 nlines = len(filelines)
2389 nlines = len(filelines)
2382 lnum = 0
2390 lnum = 0
2383 while lnum < nlines:
2391 while lnum < nlines:
2384 line = filelines[lnum]
2392 line = filelines[lnum]
2385 lnum += 1
2393 lnum += 1
2386 # don't re-insert logger status info into cache
2394 # don't re-insert logger status info into cache
2387 if line.startswith('#log#'):
2395 if line.startswith('#log#'):
2388 continue
2396 continue
2389 else:
2397 else:
2390 # build a block of code (maybe a single line) for execution
2398 # build a block of code (maybe a single line) for execution
2391 block = line
2399 block = line
2392 try:
2400 try:
2393 next = filelines[lnum] # lnum has already incremented
2401 next = filelines[lnum] # lnum has already incremented
2394 except:
2402 except:
2395 next = None
2403 next = None
2396 while next and indent_re.match(next):
2404 while next and indent_re.match(next):
2397 block += next
2405 block += next
2398 lnum += 1
2406 lnum += 1
2399 try:
2407 try:
2400 next = filelines[lnum]
2408 next = filelines[lnum]
2401 except:
2409 except:
2402 next = None
2410 next = None
2403 # now execute the block of one or more lines
2411 # now execute the block of one or more lines
2404 try:
2412 try:
2405 exec block in globs,locs
2413 exec block in globs,locs
2406 except SystemExit:
2414 except SystemExit:
2407 pass
2415 pass
2408 except:
2416 except:
2409 badblocks.append(block.rstrip())
2417 badblocks.append(block.rstrip())
2410 if kw['quiet']: # restore stdout
2418 if kw['quiet']: # restore stdout
2411 sys.stdout.close()
2419 sys.stdout.close()
2412 sys.stdout = stdout_save
2420 sys.stdout = stdout_save
2413 print 'Finished replaying log file <%s>' % fname
2421 print 'Finished replaying log file <%s>' % fname
2414 if badblocks:
2422 if badblocks:
2415 print >> sys.stderr, ('\nThe following lines/blocks in file '
2423 print >> sys.stderr, ('\nThe following lines/blocks in file '
2416 '<%s> reported errors:' % fname)
2424 '<%s> reported errors:' % fname)
2417
2425
2418 for badline in badblocks:
2426 for badline in badblocks:
2419 print >> sys.stderr, badline
2427 print >> sys.stderr, badline
2420 else: # regular file execution
2428 else: # regular file execution
2421 try:
2429 try:
2422 execfile(fname,*where)
2430 execfile(fname,*where)
2423 except SyntaxError:
2431 except SyntaxError:
2424 self.showsyntaxerror()
2432 self.showsyntaxerror()
2425 warn('Failure executing file: <%s>' % fname)
2433 warn('Failure executing file: <%s>' % fname)
2426 except SystemExit,status:
2434 except SystemExit,status:
2427 if not kw['exit_ignore']:
2435 if not kw['exit_ignore']:
2428 self.showtraceback()
2436 self.showtraceback()
2429 warn('Failure executing file: <%s>' % fname)
2437 warn('Failure executing file: <%s>' % fname)
2430 except:
2438 except:
2431 self.showtraceback()
2439 self.showtraceback()
2432 warn('Failure executing file: <%s>' % fname)
2440 warn('Failure executing file: <%s>' % fname)
2433
2441
2434 #************************* end of file <iplib.py> *****************************
2442 #************************* end of file <iplib.py> *****************************
@@ -1,5833 +1,5839 b''
1 2006-10-30 Ville Vainio <vivainio@gmail.com>
2
3 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
4 Bernsteins's patches for pydb integration.
5 http://bashdb.sourceforge.net/pydb/
6
1 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
7 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
2
8
3 * IPython/UserConfig/ipythonrc-scipy: minor clenaups to remove old
9 * IPython/UserConfig/ipythonrc-scipy: minor clenaups to remove old
4 Numeric leftovers.
10 Numeric leftovers.
5
11
6 * ipython.el (py-execute-region): apply Stefan's patch to fix
12 * ipython.el (py-execute-region): apply Stefan's patch to fix
7 garbled results if the python shell hasn't been previously started.
13 garbled results if the python shell hasn't been previously started.
8
14
9 * IPython/genutils.py (arg_split): moved to genutils, since it's a
15 * IPython/genutils.py (arg_split): moved to genutils, since it's a
10 pretty generic function and useful for other things.
16 pretty generic function and useful for other things.
11
17
12 * IPython/OInspect.py (getsource): Add customizable source
18 * IPython/OInspect.py (getsource): Add customizable source
13 extractor. After a request/patch form W. Stein (SAGE).
19 extractor. After a request/patch form W. Stein (SAGE).
14
20
15 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
21 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
16 window size to a more reasonable value from what pexpect does,
22 window size to a more reasonable value from what pexpect does,
17 since their choice causes wrapping bugs with long input lines.
23 since their choice causes wrapping bugs with long input lines.
18
24
19 2006-10-28 Ville Vainio <vivainio@gmail.com>
25 2006-10-28 Ville Vainio <vivainio@gmail.com>
20
26
21 * Magic.py (%run): Save and restore the readline history from
27 * Magic.py (%run): Save and restore the readline history from
22 file around %run commands to prevent side effects from
28 file around %run commands to prevent side effects from
23 %runned programs that might use readline (e.g. pydb).
29 %runned programs that might use readline (e.g. pydb).
24
30
25 * extensions/pydb_ipy.py: Adds %pydb magic when imported, for
31 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
26 invoking the pydb enhanced debugger.
32 invoking the pydb enhanced debugger.
27
33
28 2006-10-23 Walter Doerwald <walter@livinglogic.de>
34 2006-10-23 Walter Doerwald <walter@livinglogic.de>
29
35
30 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
36 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
31 call the base class method and propagate the return value to
37 call the base class method and propagate the return value to
32 ifile. This is now done by path itself.
38 ifile. This is now done by path itself.
33
39
34 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
40 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
35
41
36 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
42 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
37 api: set_crash_handler(), to expose the ability to change the
43 api: set_crash_handler(), to expose the ability to change the
38 internal crash handler.
44 internal crash handler.
39
45
40 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
46 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
41 the various parameters of the crash handler so that apps using
47 the various parameters of the crash handler so that apps using
42 IPython as their engine can customize crash handling. Ipmlemented
48 IPython as their engine can customize crash handling. Ipmlemented
43 at the request of SAGE.
49 at the request of SAGE.
44
50
45 2006-10-14 Ville Vainio <vivainio@gmail.com>
51 2006-10-14 Ville Vainio <vivainio@gmail.com>
46
52
47 * Magic.py, ipython.el: applied first "safe" part of Rocky
53 * Magic.py, ipython.el: applied first "safe" part of Rocky
48 Bernstein's patch set for pydb integration.
54 Bernstein's patch set for pydb integration.
49
55
50 * Magic.py (%unalias, %alias): %store'd aliases can now be
56 * Magic.py (%unalias, %alias): %store'd aliases can now be
51 removed with '%unalias'. %alias w/o args now shows most
57 removed with '%unalias'. %alias w/o args now shows most
52 interesting (stored / manually defined) aliases last
58 interesting (stored / manually defined) aliases last
53 where they catch the eye w/o scrolling.
59 where they catch the eye w/o scrolling.
54
60
55 * Magic.py (%rehashx), ext_rehashdir.py: files with
61 * Magic.py (%rehashx), ext_rehashdir.py: files with
56 'py' extension are always considered executable, even
62 'py' extension are always considered executable, even
57 when not in PATHEXT environment variable.
63 when not in PATHEXT environment variable.
58
64
59 2006-10-12 Ville Vainio <vivainio@gmail.com>
65 2006-10-12 Ville Vainio <vivainio@gmail.com>
60
66
61 * jobctrl.py: Add new "jobctrl" extension for spawning background
67 * jobctrl.py: Add new "jobctrl" extension for spawning background
62 processes with "&find /". 'import jobctrl' to try it out. Requires
68 processes with "&find /". 'import jobctrl' to try it out. Requires
63 'subprocess' module, standard in python 2.4+.
69 'subprocess' module, standard in python 2.4+.
64
70
65 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
71 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
66 so if foo -> bar and bar -> baz, then foo -> baz.
72 so if foo -> bar and bar -> baz, then foo -> baz.
67
73
68 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
74 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
69
75
70 * IPython/Magic.py (Magic.parse_options): add a new posix option
76 * IPython/Magic.py (Magic.parse_options): add a new posix option
71 to allow parsing of input args in magics that doesn't strip quotes
77 to allow parsing of input args in magics that doesn't strip quotes
72 (if posix=False). This also closes %timeit bug reported by
78 (if posix=False). This also closes %timeit bug reported by
73 Stefan.
79 Stefan.
74
80
75 2006-10-03 Ville Vainio <vivainio@gmail.com>
81 2006-10-03 Ville Vainio <vivainio@gmail.com>
76
82
77 * iplib.py (raw_input, interact): Return ValueError catching for
83 * iplib.py (raw_input, interact): Return ValueError catching for
78 raw_input. Fixes infinite loop for sys.stdin.close() or
84 raw_input. Fixes infinite loop for sys.stdin.close() or
79 sys.stdout.close().
85 sys.stdout.close().
80
86
81 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
87 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
82
88
83 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
89 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
84 to help in handling doctests. irunner is now pretty useful for
90 to help in handling doctests. irunner is now pretty useful for
85 running standalone scripts and simulate a full interactive session
91 running standalone scripts and simulate a full interactive session
86 in a format that can be then pasted as a doctest.
92 in a format that can be then pasted as a doctest.
87
93
88 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
94 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
89 on top of the default (useless) ones. This also fixes the nasty
95 on top of the default (useless) ones. This also fixes the nasty
90 way in which 2.5's Quitter() exits (reverted [1785]).
96 way in which 2.5's Quitter() exits (reverted [1785]).
91
97
92 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
98 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
93 2.5.
99 2.5.
94
100
95 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
101 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
96 color scheme is updated as well when color scheme is changed
102 color scheme is updated as well when color scheme is changed
97 interactively.
103 interactively.
98
104
99 2006-09-27 Ville Vainio <vivainio@gmail.com>
105 2006-09-27 Ville Vainio <vivainio@gmail.com>
100
106
101 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
107 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
102 infinite loop and just exit. It's a hack, but will do for a while.
108 infinite loop and just exit. It's a hack, but will do for a while.
103
109
104 2006-08-25 Walter Doerwald <walter@livinglogic.de>
110 2006-08-25 Walter Doerwald <walter@livinglogic.de>
105
111
106 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
112 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
107 the constructor, this makes it possible to get a list of only directories
113 the constructor, this makes it possible to get a list of only directories
108 or only files.
114 or only files.
109
115
110 2006-08-12 Ville Vainio <vivainio@gmail.com>
116 2006-08-12 Ville Vainio <vivainio@gmail.com>
111
117
112 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
118 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
113 they broke unittest
119 they broke unittest
114
120
115 2006-08-11 Ville Vainio <vivainio@gmail.com>
121 2006-08-11 Ville Vainio <vivainio@gmail.com>
116
122
117 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
123 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
118 by resolving issue properly, i.e. by inheriting FakeModule
124 by resolving issue properly, i.e. by inheriting FakeModule
119 from types.ModuleType. Pickling ipython interactive data
125 from types.ModuleType. Pickling ipython interactive data
120 should still work as usual (testing appreciated).
126 should still work as usual (testing appreciated).
121
127
122 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
128 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
123
129
124 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
130 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
125 running under python 2.3 with code from 2.4 to fix a bug with
131 running under python 2.3 with code from 2.4 to fix a bug with
126 help(). Reported by the Debian maintainers, Norbert Tretkowski
132 help(). Reported by the Debian maintainers, Norbert Tretkowski
127 <norbert-AT-tretkowski.de> and Alexandre Fayolle
133 <norbert-AT-tretkowski.de> and Alexandre Fayolle
128 <afayolle-AT-debian.org>.
134 <afayolle-AT-debian.org>.
129
135
130 2006-08-04 Walter Doerwald <walter@livinglogic.de>
136 2006-08-04 Walter Doerwald <walter@livinglogic.de>
131
137
132 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
138 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
133 (which was displaying "quit" twice).
139 (which was displaying "quit" twice).
134
140
135 2006-07-28 Walter Doerwald <walter@livinglogic.de>
141 2006-07-28 Walter Doerwald <walter@livinglogic.de>
136
142
137 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
143 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
138 the mode argument).
144 the mode argument).
139
145
140 2006-07-27 Walter Doerwald <walter@livinglogic.de>
146 2006-07-27 Walter Doerwald <walter@livinglogic.de>
141
147
142 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
148 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
143 not running under IPython.
149 not running under IPython.
144
150
145 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
151 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
146 and make it iterable (iterating over the attribute itself). Add two new
152 and make it iterable (iterating over the attribute itself). Add two new
147 magic strings for __xattrs__(): If the string starts with "-", the attribute
153 magic strings for __xattrs__(): If the string starts with "-", the attribute
148 will not be displayed in ibrowse's detail view (but it can still be
154 will not be displayed in ibrowse's detail view (but it can still be
149 iterated over). This makes it possible to add attributes that are large
155 iterated over). This makes it possible to add attributes that are large
150 lists or generator methods to the detail view. Replace magic attribute names
156 lists or generator methods to the detail view. Replace magic attribute names
151 and _attrname() and _getattr() with "descriptors": For each type of magic
157 and _attrname() and _getattr() with "descriptors": For each type of magic
152 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
158 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
153 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
159 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
154 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
160 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
155 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
161 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
156 are still supported.
162 are still supported.
157
163
158 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
164 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
159 fails in ibrowse.fetch(), the exception object is added as the last item
165 fails in ibrowse.fetch(), the exception object is added as the last item
160 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
166 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
161 a generator throws an exception midway through execution.
167 a generator throws an exception midway through execution.
162
168
163 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
169 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
164 encoding into methods.
170 encoding into methods.
165
171
166 2006-07-26 Ville Vainio <vivainio@gmail.com>
172 2006-07-26 Ville Vainio <vivainio@gmail.com>
167
173
168 * iplib.py: history now stores multiline input as single
174 * iplib.py: history now stores multiline input as single
169 history entries. Patch by Jorgen Cederlof.
175 history entries. Patch by Jorgen Cederlof.
170
176
171 2006-07-18 Walter Doerwald <walter@livinglogic.de>
177 2006-07-18 Walter Doerwald <walter@livinglogic.de>
172
178
173 * IPython/Extensions/ibrowse.py: Make cursor visible over
179 * IPython/Extensions/ibrowse.py: Make cursor visible over
174 non existing attributes.
180 non existing attributes.
175
181
176 2006-07-14 Walter Doerwald <walter@livinglogic.de>
182 2006-07-14 Walter Doerwald <walter@livinglogic.de>
177
183
178 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
184 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
179 error output of the running command doesn't mess up the screen.
185 error output of the running command doesn't mess up the screen.
180
186
181 2006-07-13 Walter Doerwald <walter@livinglogic.de>
187 2006-07-13 Walter Doerwald <walter@livinglogic.de>
182
188
183 * IPython/Extensions/ipipe.py (isort): Make isort usable without
189 * IPython/Extensions/ipipe.py (isort): Make isort usable without
184 argument. This sorts the items themselves.
190 argument. This sorts the items themselves.
185
191
186 2006-07-12 Walter Doerwald <walter@livinglogic.de>
192 2006-07-12 Walter Doerwald <walter@livinglogic.de>
187
193
188 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
194 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
189 Compile expression strings into code objects. This should speed
195 Compile expression strings into code objects. This should speed
190 up ifilter and friends somewhat.
196 up ifilter and friends somewhat.
191
197
192 2006-07-08 Ville Vainio <vivainio@gmail.com>
198 2006-07-08 Ville Vainio <vivainio@gmail.com>
193
199
194 * Magic.py: %cpaste now strips > from the beginning of lines
200 * Magic.py: %cpaste now strips > from the beginning of lines
195 to ease pasting quoted code from emails. Contributed by
201 to ease pasting quoted code from emails. Contributed by
196 Stefan van der Walt.
202 Stefan van der Walt.
197
203
198 2006-06-29 Ville Vainio <vivainio@gmail.com>
204 2006-06-29 Ville Vainio <vivainio@gmail.com>
199
205
200 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
206 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
201 mode, patch contributed by Darren Dale. NEEDS TESTING!
207 mode, patch contributed by Darren Dale. NEEDS TESTING!
202
208
203 2006-06-28 Walter Doerwald <walter@livinglogic.de>
209 2006-06-28 Walter Doerwald <walter@livinglogic.de>
204
210
205 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
211 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
206 a blue background. Fix fetching new display rows when the browser
212 a blue background. Fix fetching new display rows when the browser
207 scrolls more than a screenful (e.g. by using the goto command).
213 scrolls more than a screenful (e.g. by using the goto command).
208
214
209 2006-06-27 Ville Vainio <vivainio@gmail.com>
215 2006-06-27 Ville Vainio <vivainio@gmail.com>
210
216
211 * Magic.py (_inspect, _ofind) Apply David Huard's
217 * Magic.py (_inspect, _ofind) Apply David Huard's
212 patch for displaying the correct docstring for 'property'
218 patch for displaying the correct docstring for 'property'
213 attributes.
219 attributes.
214
220
215 2006-06-23 Walter Doerwald <walter@livinglogic.de>
221 2006-06-23 Walter Doerwald <walter@livinglogic.de>
216
222
217 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
223 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
218 commands into the methods implementing them.
224 commands into the methods implementing them.
219
225
220 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
226 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
221
227
222 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
228 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
223 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
229 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
224 autoindent support was authored by Jin Liu.
230 autoindent support was authored by Jin Liu.
225
231
226 2006-06-22 Walter Doerwald <walter@livinglogic.de>
232 2006-06-22 Walter Doerwald <walter@livinglogic.de>
227
233
228 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
234 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
229 for keymaps with a custom class that simplifies handling.
235 for keymaps with a custom class that simplifies handling.
230
236
231 2006-06-19 Walter Doerwald <walter@livinglogic.de>
237 2006-06-19 Walter Doerwald <walter@livinglogic.de>
232
238
233 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
239 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
234 resizing. This requires Python 2.5 to work.
240 resizing. This requires Python 2.5 to work.
235
241
236 2006-06-16 Walter Doerwald <walter@livinglogic.de>
242 2006-06-16 Walter Doerwald <walter@livinglogic.de>
237
243
238 * IPython/Extensions/ibrowse.py: Add two new commands to
244 * IPython/Extensions/ibrowse.py: Add two new commands to
239 ibrowse: "hideattr" (mapped to "h") hides the attribute under
245 ibrowse: "hideattr" (mapped to "h") hides the attribute under
240 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
246 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
241 attributes again. Remapped the help command to "?". Display
247 attributes again. Remapped the help command to "?". Display
242 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
248 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
243 as keys for the "home" and "end" commands. Add three new commands
249 as keys for the "home" and "end" commands. Add three new commands
244 to the input mode for "find" and friends: "delend" (CTRL-K)
250 to the input mode for "find" and friends: "delend" (CTRL-K)
245 deletes to the end of line. "incsearchup" searches upwards in the
251 deletes to the end of line. "incsearchup" searches upwards in the
246 command history for an input that starts with the text before the cursor.
252 command history for an input that starts with the text before the cursor.
247 "incsearchdown" does the same downwards. Removed a bogus mapping of
253 "incsearchdown" does the same downwards. Removed a bogus mapping of
248 the x key to "delete".
254 the x key to "delete".
249
255
250 2006-06-15 Ville Vainio <vivainio@gmail.com>
256 2006-06-15 Ville Vainio <vivainio@gmail.com>
251
257
252 * iplib.py, hooks.py: Added new generate_prompt hook that can be
258 * iplib.py, hooks.py: Added new generate_prompt hook that can be
253 used to create prompts dynamically, instead of the "old" way of
259 used to create prompts dynamically, instead of the "old" way of
254 assigning "magic" strings to prompt_in1 and prompt_in2. The old
260 assigning "magic" strings to prompt_in1 and prompt_in2. The old
255 way still works (it's invoked by the default hook), of course.
261 way still works (it's invoked by the default hook), of course.
256
262
257 * Prompts.py: added generate_output_prompt hook for altering output
263 * Prompts.py: added generate_output_prompt hook for altering output
258 prompt
264 prompt
259
265
260 * Release.py: Changed version string to 0.7.3.svn.
266 * Release.py: Changed version string to 0.7.3.svn.
261
267
262 2006-06-15 Walter Doerwald <walter@livinglogic.de>
268 2006-06-15 Walter Doerwald <walter@livinglogic.de>
263
269
264 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
270 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
265 the call to fetch() always tries to fetch enough data for at least one
271 the call to fetch() always tries to fetch enough data for at least one
266 full screen. This makes it possible to simply call moveto(0,0,True) in
272 full screen. This makes it possible to simply call moveto(0,0,True) in
267 the constructor. Fix typos and removed the obsolete goto attribute.
273 the constructor. Fix typos and removed the obsolete goto attribute.
268
274
269 2006-06-12 Ville Vainio <vivainio@gmail.com>
275 2006-06-12 Ville Vainio <vivainio@gmail.com>
270
276
271 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
277 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
272 allowing $variable interpolation within multiline statements,
278 allowing $variable interpolation within multiline statements,
273 though so far only with "sh" profile for a testing period.
279 though so far only with "sh" profile for a testing period.
274 The patch also enables splitting long commands with \ but it
280 The patch also enables splitting long commands with \ but it
275 doesn't work properly yet.
281 doesn't work properly yet.
276
282
277 2006-06-12 Walter Doerwald <walter@livinglogic.de>
283 2006-06-12 Walter Doerwald <walter@livinglogic.de>
278
284
279 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
285 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
280 input history and the position of the cursor in the input history for
286 input history and the position of the cursor in the input history for
281 the find, findbackwards and goto command.
287 the find, findbackwards and goto command.
282
288
283 2006-06-10 Walter Doerwald <walter@livinglogic.de>
289 2006-06-10 Walter Doerwald <walter@livinglogic.de>
284
290
285 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
291 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
286 implements the basic functionality of browser commands that require
292 implements the basic functionality of browser commands that require
287 input. Reimplement the goto, find and findbackwards commands as
293 input. Reimplement the goto, find and findbackwards commands as
288 subclasses of _CommandInput. Add an input history and keymaps to those
294 subclasses of _CommandInput. Add an input history and keymaps to those
289 commands. Add "\r" as a keyboard shortcut for the enterdefault and
295 commands. Add "\r" as a keyboard shortcut for the enterdefault and
290 execute commands.
296 execute commands.
291
297
292 2006-06-07 Ville Vainio <vivainio@gmail.com>
298 2006-06-07 Ville Vainio <vivainio@gmail.com>
293
299
294 * iplib.py: ipython mybatch.ipy exits ipython immediately after
300 * iplib.py: ipython mybatch.ipy exits ipython immediately after
295 running the batch files instead of leaving the session open.
301 running the batch files instead of leaving the session open.
296
302
297 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
303 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
298
304
299 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
305 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
300 the original fix was incomplete. Patch submitted by W. Maier.
306 the original fix was incomplete. Patch submitted by W. Maier.
301
307
302 2006-06-07 Ville Vainio <vivainio@gmail.com>
308 2006-06-07 Ville Vainio <vivainio@gmail.com>
303
309
304 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
310 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
305 Confirmation prompts can be supressed by 'quiet' option.
311 Confirmation prompts can be supressed by 'quiet' option.
306 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
312 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
307
313
308 2006-06-06 *** Released version 0.7.2
314 2006-06-06 *** Released version 0.7.2
309
315
310 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
316 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
311
317
312 * IPython/Release.py (version): Made 0.7.2 final for release.
318 * IPython/Release.py (version): Made 0.7.2 final for release.
313 Repo tagged and release cut.
319 Repo tagged and release cut.
314
320
315 2006-06-05 Ville Vainio <vivainio@gmail.com>
321 2006-06-05 Ville Vainio <vivainio@gmail.com>
316
322
317 * Magic.py (magic_rehashx): Honor no_alias list earlier in
323 * Magic.py (magic_rehashx): Honor no_alias list earlier in
318 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
324 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
319
325
320 * upgrade_dir.py: try import 'path' module a bit harder
326 * upgrade_dir.py: try import 'path' module a bit harder
321 (for %upgrade)
327 (for %upgrade)
322
328
323 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
329 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
324
330
325 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
331 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
326 instead of looping 20 times.
332 instead of looping 20 times.
327
333
328 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
334 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
329 correctly at initialization time. Bug reported by Krishna Mohan
335 correctly at initialization time. Bug reported by Krishna Mohan
330 Gundu <gkmohan-AT-gmail.com> on the user list.
336 Gundu <gkmohan-AT-gmail.com> on the user list.
331
337
332 * IPython/Release.py (version): Mark 0.7.2 version to start
338 * IPython/Release.py (version): Mark 0.7.2 version to start
333 testing for release on 06/06.
339 testing for release on 06/06.
334
340
335 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
341 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
336
342
337 * scripts/irunner: thin script interface so users don't have to
343 * scripts/irunner: thin script interface so users don't have to
338 find the module and call it as an executable, since modules rarely
344 find the module and call it as an executable, since modules rarely
339 live in people's PATH.
345 live in people's PATH.
340
346
341 * IPython/irunner.py (InteractiveRunner.__init__): added
347 * IPython/irunner.py (InteractiveRunner.__init__): added
342 delaybeforesend attribute to control delays with newer versions of
348 delaybeforesend attribute to control delays with newer versions of
343 pexpect. Thanks to detailed help from pexpect's author, Noah
349 pexpect. Thanks to detailed help from pexpect's author, Noah
344 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
350 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
345 correctly (it works in NoColor mode).
351 correctly (it works in NoColor mode).
346
352
347 * IPython/iplib.py (handle_normal): fix nasty crash reported on
353 * IPython/iplib.py (handle_normal): fix nasty crash reported on
348 SAGE list, from improper log() calls.
354 SAGE list, from improper log() calls.
349
355
350 2006-05-31 Ville Vainio <vivainio@gmail.com>
356 2006-05-31 Ville Vainio <vivainio@gmail.com>
351
357
352 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
358 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
353 with args in parens to work correctly with dirs that have spaces.
359 with args in parens to work correctly with dirs that have spaces.
354
360
355 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
361 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
356
362
357 * IPython/Logger.py (Logger.logstart): add option to log raw input
363 * IPython/Logger.py (Logger.logstart): add option to log raw input
358 instead of the processed one. A -r flag was added to the
364 instead of the processed one. A -r flag was added to the
359 %logstart magic used for controlling logging.
365 %logstart magic used for controlling logging.
360
366
361 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
367 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
362
368
363 * IPython/iplib.py (InteractiveShell.__init__): add check for the
369 * IPython/iplib.py (InteractiveShell.__init__): add check for the
364 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
370 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
365 recognize the option. After a bug report by Will Maier. This
371 recognize the option. After a bug report by Will Maier. This
366 closes #64 (will do it after confirmation from W. Maier).
372 closes #64 (will do it after confirmation from W. Maier).
367
373
368 * IPython/irunner.py: New module to run scripts as if manually
374 * IPython/irunner.py: New module to run scripts as if manually
369 typed into an interactive environment, based on pexpect. After a
375 typed into an interactive environment, based on pexpect. After a
370 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
376 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
371 ipython-user list. Simple unittests in the tests/ directory.
377 ipython-user list. Simple unittests in the tests/ directory.
372
378
373 * tools/release: add Will Maier, OpenBSD port maintainer, to
379 * tools/release: add Will Maier, OpenBSD port maintainer, to
374 recepients list. We are now officially part of the OpenBSD ports:
380 recepients list. We are now officially part of the OpenBSD ports:
375 http://www.openbsd.org/ports.html ! Many thanks to Will for the
381 http://www.openbsd.org/ports.html ! Many thanks to Will for the
376 work.
382 work.
377
383
378 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
384 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
379
385
380 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
386 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
381 so that it doesn't break tkinter apps.
387 so that it doesn't break tkinter apps.
382
388
383 * IPython/iplib.py (_prefilter): fix bug where aliases would
389 * IPython/iplib.py (_prefilter): fix bug where aliases would
384 shadow variables when autocall was fully off. Reported by SAGE
390 shadow variables when autocall was fully off. Reported by SAGE
385 author William Stein.
391 author William Stein.
386
392
387 * IPython/OInspect.py (Inspector.__init__): add a flag to control
393 * IPython/OInspect.py (Inspector.__init__): add a flag to control
388 at what detail level strings are computed when foo? is requested.
394 at what detail level strings are computed when foo? is requested.
389 This allows users to ask for example that the string form of an
395 This allows users to ask for example that the string form of an
390 object is only computed when foo?? is called, or even never, by
396 object is only computed when foo?? is called, or even never, by
391 setting the object_info_string_level >= 2 in the configuration
397 setting the object_info_string_level >= 2 in the configuration
392 file. This new option has been added and documented. After a
398 file. This new option has been added and documented. After a
393 request by SAGE to be able to control the printing of very large
399 request by SAGE to be able to control the printing of very large
394 objects more easily.
400 objects more easily.
395
401
396 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
402 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
397
403
398 * IPython/ipmaker.py (make_IPython): remove the ipython call path
404 * IPython/ipmaker.py (make_IPython): remove the ipython call path
399 from sys.argv, to be 100% consistent with how Python itself works
405 from sys.argv, to be 100% consistent with how Python itself works
400 (as seen for example with python -i file.py). After a bug report
406 (as seen for example with python -i file.py). After a bug report
401 by Jeffrey Collins.
407 by Jeffrey Collins.
402
408
403 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
409 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
404 nasty bug which was preventing custom namespaces with -pylab,
410 nasty bug which was preventing custom namespaces with -pylab,
405 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
411 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
406 compatibility (long gone from mpl).
412 compatibility (long gone from mpl).
407
413
408 * IPython/ipapi.py (make_session): name change: create->make. We
414 * IPython/ipapi.py (make_session): name change: create->make. We
409 use make in other places (ipmaker,...), it's shorter and easier to
415 use make in other places (ipmaker,...), it's shorter and easier to
410 type and say, etc. I'm trying to clean things before 0.7.2 so
416 type and say, etc. I'm trying to clean things before 0.7.2 so
411 that I can keep things stable wrt to ipapi in the chainsaw branch.
417 that I can keep things stable wrt to ipapi in the chainsaw branch.
412
418
413 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
419 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
414 python-mode recognizes our debugger mode. Add support for
420 python-mode recognizes our debugger mode. Add support for
415 autoindent inside (X)emacs. After a patch sent in by Jin Liu
421 autoindent inside (X)emacs. After a patch sent in by Jin Liu
416 <m.liu.jin-AT-gmail.com> originally written by
422 <m.liu.jin-AT-gmail.com> originally written by
417 doxgen-AT-newsmth.net (with minor modifications for xemacs
423 doxgen-AT-newsmth.net (with minor modifications for xemacs
418 compatibility)
424 compatibility)
419
425
420 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
426 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
421 tracebacks when walking the stack so that the stack tracking system
427 tracebacks when walking the stack so that the stack tracking system
422 in emacs' python-mode can identify the frames correctly.
428 in emacs' python-mode can identify the frames correctly.
423
429
424 * IPython/ipmaker.py (make_IPython): make the internal (and
430 * IPython/ipmaker.py (make_IPython): make the internal (and
425 default config) autoedit_syntax value false by default. Too many
431 default config) autoedit_syntax value false by default. Too many
426 users have complained to me (both on and off-list) about problems
432 users have complained to me (both on and off-list) about problems
427 with this option being on by default, so I'm making it default to
433 with this option being on by default, so I'm making it default to
428 off. It can still be enabled by anyone via the usual mechanisms.
434 off. It can still be enabled by anyone via the usual mechanisms.
429
435
430 * IPython/completer.py (Completer.attr_matches): add support for
436 * IPython/completer.py (Completer.attr_matches): add support for
431 PyCrust-style _getAttributeNames magic method. Patch contributed
437 PyCrust-style _getAttributeNames magic method. Patch contributed
432 by <mscott-AT-goldenspud.com>. Closes #50.
438 by <mscott-AT-goldenspud.com>. Closes #50.
433
439
434 * IPython/iplib.py (InteractiveShell.__init__): remove the
440 * IPython/iplib.py (InteractiveShell.__init__): remove the
435 deletion of exit/quit from __builtin__, which can break
441 deletion of exit/quit from __builtin__, which can break
436 third-party tools like the Zope debugging console. The
442 third-party tools like the Zope debugging console. The
437 %exit/%quit magics remain. In general, it's probably a good idea
443 %exit/%quit magics remain. In general, it's probably a good idea
438 not to delete anything from __builtin__, since we never know what
444 not to delete anything from __builtin__, since we never know what
439 that will break. In any case, python now (for 2.5) will support
445 that will break. In any case, python now (for 2.5) will support
440 'real' exit/quit, so this issue is moot. Closes #55.
446 'real' exit/quit, so this issue is moot. Closes #55.
441
447
442 * IPython/genutils.py (with_obj): rename the 'with' function to
448 * IPython/genutils.py (with_obj): rename the 'with' function to
443 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
449 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
444 becomes a language keyword. Closes #53.
450 becomes a language keyword. Closes #53.
445
451
446 * IPython/FakeModule.py (FakeModule.__init__): add a proper
452 * IPython/FakeModule.py (FakeModule.__init__): add a proper
447 __file__ attribute to this so it fools more things into thinking
453 __file__ attribute to this so it fools more things into thinking
448 it is a real module. Closes #59.
454 it is a real module. Closes #59.
449
455
450 * IPython/Magic.py (magic_edit): add -n option to open the editor
456 * IPython/Magic.py (magic_edit): add -n option to open the editor
451 at a specific line number. After a patch by Stefan van der Walt.
457 at a specific line number. After a patch by Stefan van der Walt.
452
458
453 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
459 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
454
460
455 * IPython/iplib.py (edit_syntax_error): fix crash when for some
461 * IPython/iplib.py (edit_syntax_error): fix crash when for some
456 reason the file could not be opened. After automatic crash
462 reason the file could not be opened. After automatic crash
457 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
463 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
458 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
464 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
459 (_should_recompile): Don't fire editor if using %bg, since there
465 (_should_recompile): Don't fire editor if using %bg, since there
460 is no file in the first place. From the same report as above.
466 is no file in the first place. From the same report as above.
461 (raw_input): protect against faulty third-party prefilters. After
467 (raw_input): protect against faulty third-party prefilters. After
462 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
468 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
463 while running under SAGE.
469 while running under SAGE.
464
470
465 2006-05-23 Ville Vainio <vivainio@gmail.com>
471 2006-05-23 Ville Vainio <vivainio@gmail.com>
466
472
467 * ipapi.py: Stripped down ip.to_user_ns() to work only as
473 * ipapi.py: Stripped down ip.to_user_ns() to work only as
468 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
474 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
469 now returns None (again), unless dummy is specifically allowed by
475 now returns None (again), unless dummy is specifically allowed by
470 ipapi.get(allow_dummy=True).
476 ipapi.get(allow_dummy=True).
471
477
472 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
478 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
473
479
474 * IPython: remove all 2.2-compatibility objects and hacks from
480 * IPython: remove all 2.2-compatibility objects and hacks from
475 everywhere, since we only support 2.3 at this point. Docs
481 everywhere, since we only support 2.3 at this point. Docs
476 updated.
482 updated.
477
483
478 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
484 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
479 Anything requiring extra validation can be turned into a Python
485 Anything requiring extra validation can be turned into a Python
480 property in the future. I used a property for the db one b/c
486 property in the future. I used a property for the db one b/c
481 there was a nasty circularity problem with the initialization
487 there was a nasty circularity problem with the initialization
482 order, which right now I don't have time to clean up.
488 order, which right now I don't have time to clean up.
483
489
484 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
490 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
485 another locking bug reported by Jorgen. I'm not 100% sure though,
491 another locking bug reported by Jorgen. I'm not 100% sure though,
486 so more testing is needed...
492 so more testing is needed...
487
493
488 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
494 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
489
495
490 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
496 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
491 local variables from any routine in user code (typically executed
497 local variables from any routine in user code (typically executed
492 with %run) directly into the interactive namespace. Very useful
498 with %run) directly into the interactive namespace. Very useful
493 when doing complex debugging.
499 when doing complex debugging.
494 (IPythonNotRunning): Changed the default None object to a dummy
500 (IPythonNotRunning): Changed the default None object to a dummy
495 whose attributes can be queried as well as called without
501 whose attributes can be queried as well as called without
496 exploding, to ease writing code which works transparently both in
502 exploding, to ease writing code which works transparently both in
497 and out of ipython and uses some of this API.
503 and out of ipython and uses some of this API.
498
504
499 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
505 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
500
506
501 * IPython/hooks.py (result_display): Fix the fact that our display
507 * IPython/hooks.py (result_display): Fix the fact that our display
502 hook was using str() instead of repr(), as the default python
508 hook was using str() instead of repr(), as the default python
503 console does. This had gone unnoticed b/c it only happened if
509 console does. This had gone unnoticed b/c it only happened if
504 %Pprint was off, but the inconsistency was there.
510 %Pprint was off, but the inconsistency was there.
505
511
506 2006-05-15 Ville Vainio <vivainio@gmail.com>
512 2006-05-15 Ville Vainio <vivainio@gmail.com>
507
513
508 * Oinspect.py: Only show docstring for nonexisting/binary files
514 * Oinspect.py: Only show docstring for nonexisting/binary files
509 when doing object??, closing ticket #62
515 when doing object??, closing ticket #62
510
516
511 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
517 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
512
518
513 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
519 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
514 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
520 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
515 was being released in a routine which hadn't checked if it had
521 was being released in a routine which hadn't checked if it had
516 been the one to acquire it.
522 been the one to acquire it.
517
523
518 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
524 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
519
525
520 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
526 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
521
527
522 2006-04-11 Ville Vainio <vivainio@gmail.com>
528 2006-04-11 Ville Vainio <vivainio@gmail.com>
523
529
524 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
530 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
525 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
531 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
526 prefilters, allowing stuff like magics and aliases in the file.
532 prefilters, allowing stuff like magics and aliases in the file.
527
533
528 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
534 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
529 added. Supported now are "%clear in" and "%clear out" (clear input and
535 added. Supported now are "%clear in" and "%clear out" (clear input and
530 output history, respectively). Also fixed CachedOutput.flush to
536 output history, respectively). Also fixed CachedOutput.flush to
531 properly flush the output cache.
537 properly flush the output cache.
532
538
533 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
539 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
534 half-success (and fail explicitly).
540 half-success (and fail explicitly).
535
541
536 2006-03-28 Ville Vainio <vivainio@gmail.com>
542 2006-03-28 Ville Vainio <vivainio@gmail.com>
537
543
538 * iplib.py: Fix quoting of aliases so that only argless ones
544 * iplib.py: Fix quoting of aliases so that only argless ones
539 are quoted
545 are quoted
540
546
541 2006-03-28 Ville Vainio <vivainio@gmail.com>
547 2006-03-28 Ville Vainio <vivainio@gmail.com>
542
548
543 * iplib.py: Quote aliases with spaces in the name.
549 * iplib.py: Quote aliases with spaces in the name.
544 "c:\program files\blah\bin" is now legal alias target.
550 "c:\program files\blah\bin" is now legal alias target.
545
551
546 * ext_rehashdir.py: Space no longer allowed as arg
552 * ext_rehashdir.py: Space no longer allowed as arg
547 separator, since space is legal in path names.
553 separator, since space is legal in path names.
548
554
549 2006-03-16 Ville Vainio <vivainio@gmail.com>
555 2006-03-16 Ville Vainio <vivainio@gmail.com>
550
556
551 * upgrade_dir.py: Take path.py from Extensions, correcting
557 * upgrade_dir.py: Take path.py from Extensions, correcting
552 %upgrade magic
558 %upgrade magic
553
559
554 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
560 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
555
561
556 * hooks.py: Only enclose editor binary in quotes if legal and
562 * hooks.py: Only enclose editor binary in quotes if legal and
557 necessary (space in the name, and is an existing file). Fixes a bug
563 necessary (space in the name, and is an existing file). Fixes a bug
558 reported by Zachary Pincus.
564 reported by Zachary Pincus.
559
565
560 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
566 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
561
567
562 * Manual: thanks to a tip on proper color handling for Emacs, by
568 * Manual: thanks to a tip on proper color handling for Emacs, by
563 Eric J Haywiser <ejh1-AT-MIT.EDU>.
569 Eric J Haywiser <ejh1-AT-MIT.EDU>.
564
570
565 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
571 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
566 by applying the provided patch. Thanks to Liu Jin
572 by applying the provided patch. Thanks to Liu Jin
567 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
573 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
568 XEmacs/Linux, I'm trusting the submitter that it actually helps
574 XEmacs/Linux, I'm trusting the submitter that it actually helps
569 under win32/GNU Emacs. Will revisit if any problems are reported.
575 under win32/GNU Emacs. Will revisit if any problems are reported.
570
576
571 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
577 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
572
578
573 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
579 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
574 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
580 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
575
581
576 2006-03-12 Ville Vainio <vivainio@gmail.com>
582 2006-03-12 Ville Vainio <vivainio@gmail.com>
577
583
578 * Magic.py (magic_timeit): Added %timeit magic, contributed by
584 * Magic.py (magic_timeit): Added %timeit magic, contributed by
579 Torsten Marek.
585 Torsten Marek.
580
586
581 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
587 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
582
588
583 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
589 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
584 line ranges works again.
590 line ranges works again.
585
591
586 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
592 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
587
593
588 * IPython/iplib.py (showtraceback): add back sys.last_traceback
594 * IPython/iplib.py (showtraceback): add back sys.last_traceback
589 and friends, after a discussion with Zach Pincus on ipython-user.
595 and friends, after a discussion with Zach Pincus on ipython-user.
590 I'm not 100% sure, but after thinking about it quite a bit, it may
596 I'm not 100% sure, but after thinking about it quite a bit, it may
591 be OK. Testing with the multithreaded shells didn't reveal any
597 be OK. Testing with the multithreaded shells didn't reveal any
592 problems, but let's keep an eye out.
598 problems, but let's keep an eye out.
593
599
594 In the process, I fixed a few things which were calling
600 In the process, I fixed a few things which were calling
595 self.InteractiveTB() directly (like safe_execfile), which is a
601 self.InteractiveTB() directly (like safe_execfile), which is a
596 mistake: ALL exception reporting should be done by calling
602 mistake: ALL exception reporting should be done by calling
597 self.showtraceback(), which handles state and tab-completion and
603 self.showtraceback(), which handles state and tab-completion and
598 more.
604 more.
599
605
600 2006-03-01 Ville Vainio <vivainio@gmail.com>
606 2006-03-01 Ville Vainio <vivainio@gmail.com>
601
607
602 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
608 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
603 To use, do "from ipipe import *".
609 To use, do "from ipipe import *".
604
610
605 2006-02-24 Ville Vainio <vivainio@gmail.com>
611 2006-02-24 Ville Vainio <vivainio@gmail.com>
606
612
607 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
613 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
608 "cleanly" and safely than the older upgrade mechanism.
614 "cleanly" and safely than the older upgrade mechanism.
609
615
610 2006-02-21 Ville Vainio <vivainio@gmail.com>
616 2006-02-21 Ville Vainio <vivainio@gmail.com>
611
617
612 * Magic.py: %save works again.
618 * Magic.py: %save works again.
613
619
614 2006-02-15 Ville Vainio <vivainio@gmail.com>
620 2006-02-15 Ville Vainio <vivainio@gmail.com>
615
621
616 * Magic.py: %Pprint works again
622 * Magic.py: %Pprint works again
617
623
618 * Extensions/ipy_sane_defaults.py: Provide everything provided
624 * Extensions/ipy_sane_defaults.py: Provide everything provided
619 in default ipythonrc, to make it possible to have a completely empty
625 in default ipythonrc, to make it possible to have a completely empty
620 ipythonrc (and thus completely rc-file free configuration)
626 ipythonrc (and thus completely rc-file free configuration)
621
627
622 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
628 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
623
629
624 * IPython/hooks.py (editor): quote the call to the editor command,
630 * IPython/hooks.py (editor): quote the call to the editor command,
625 to allow commands with spaces in them. Problem noted by watching
631 to allow commands with spaces in them. Problem noted by watching
626 Ian Oswald's video about textpad under win32 at
632 Ian Oswald's video about textpad under win32 at
627 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
633 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
628
634
629 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
635 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
630 describing magics (we haven't used @ for a loong time).
636 describing magics (we haven't used @ for a loong time).
631
637
632 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
638 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
633 contributed by marienz to close
639 contributed by marienz to close
634 http://www.scipy.net/roundup/ipython/issue53.
640 http://www.scipy.net/roundup/ipython/issue53.
635
641
636 2006-02-10 Ville Vainio <vivainio@gmail.com>
642 2006-02-10 Ville Vainio <vivainio@gmail.com>
637
643
638 * genutils.py: getoutput now works in win32 too
644 * genutils.py: getoutput now works in win32 too
639
645
640 * completer.py: alias and magic completion only invoked
646 * completer.py: alias and magic completion only invoked
641 at the first "item" in the line, to avoid "cd %store"
647 at the first "item" in the line, to avoid "cd %store"
642 nonsense.
648 nonsense.
643
649
644 2006-02-09 Ville Vainio <vivainio@gmail.com>
650 2006-02-09 Ville Vainio <vivainio@gmail.com>
645
651
646 * test/*: Added a unit testing framework (finally).
652 * test/*: Added a unit testing framework (finally).
647 '%run runtests.py' to run test_*.
653 '%run runtests.py' to run test_*.
648
654
649 * ipapi.py: Exposed runlines and set_custom_exc
655 * ipapi.py: Exposed runlines and set_custom_exc
650
656
651 2006-02-07 Ville Vainio <vivainio@gmail.com>
657 2006-02-07 Ville Vainio <vivainio@gmail.com>
652
658
653 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
659 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
654 instead use "f(1 2)" as before.
660 instead use "f(1 2)" as before.
655
661
656 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
662 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
657
663
658 * IPython/demo.py (IPythonDemo): Add new classes to the demo
664 * IPython/demo.py (IPythonDemo): Add new classes to the demo
659 facilities, for demos processed by the IPython input filter
665 facilities, for demos processed by the IPython input filter
660 (IPythonDemo), and for running a script one-line-at-a-time as a
666 (IPythonDemo), and for running a script one-line-at-a-time as a
661 demo, both for pure Python (LineDemo) and for IPython-processed
667 demo, both for pure Python (LineDemo) and for IPython-processed
662 input (IPythonLineDemo). After a request by Dave Kohel, from the
668 input (IPythonLineDemo). After a request by Dave Kohel, from the
663 SAGE team.
669 SAGE team.
664 (Demo.edit): added an edit() method to the demo objects, to edit
670 (Demo.edit): added an edit() method to the demo objects, to edit
665 the in-memory copy of the last executed block.
671 the in-memory copy of the last executed block.
666
672
667 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
673 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
668 processing to %edit, %macro and %save. These commands can now be
674 processing to %edit, %macro and %save. These commands can now be
669 invoked on the unprocessed input as it was typed by the user
675 invoked on the unprocessed input as it was typed by the user
670 (without any prefilters applied). After requests by the SAGE team
676 (without any prefilters applied). After requests by the SAGE team
671 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
677 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
672
678
673 2006-02-01 Ville Vainio <vivainio@gmail.com>
679 2006-02-01 Ville Vainio <vivainio@gmail.com>
674
680
675 * setup.py, eggsetup.py: easy_install ipython==dev works
681 * setup.py, eggsetup.py: easy_install ipython==dev works
676 correctly now (on Linux)
682 correctly now (on Linux)
677
683
678 * ipy_user_conf,ipmaker: user config changes, removed spurious
684 * ipy_user_conf,ipmaker: user config changes, removed spurious
679 warnings
685 warnings
680
686
681 * iplib: if rc.banner is string, use it as is.
687 * iplib: if rc.banner is string, use it as is.
682
688
683 * Magic: %pycat accepts a string argument and pages it's contents.
689 * Magic: %pycat accepts a string argument and pages it's contents.
684
690
685
691
686 2006-01-30 Ville Vainio <vivainio@gmail.com>
692 2006-01-30 Ville Vainio <vivainio@gmail.com>
687
693
688 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
694 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
689 Now %store and bookmarks work through PickleShare, meaning that
695 Now %store and bookmarks work through PickleShare, meaning that
690 concurrent access is possible and all ipython sessions see the
696 concurrent access is possible and all ipython sessions see the
691 same database situation all the time, instead of snapshot of
697 same database situation all the time, instead of snapshot of
692 the situation when the session was started. Hence, %bookmark
698 the situation when the session was started. Hence, %bookmark
693 results are immediately accessible from othes sessions. The database
699 results are immediately accessible from othes sessions. The database
694 is also available for use by user extensions. See:
700 is also available for use by user extensions. See:
695 http://www.python.org/pypi/pickleshare
701 http://www.python.org/pypi/pickleshare
696
702
697 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
703 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
698
704
699 * aliases can now be %store'd
705 * aliases can now be %store'd
700
706
701 * path.py moved to Extensions so that pickleshare does not need
707 * path.py moved to Extensions so that pickleshare does not need
702 IPython-specific import. Extensions added to pythonpath right
708 IPython-specific import. Extensions added to pythonpath right
703 at __init__.
709 at __init__.
704
710
705 * iplib.py: ipalias deprecated/redundant; aliases are converted and
711 * iplib.py: ipalias deprecated/redundant; aliases are converted and
706 called with _ip.system and the pre-transformed command string.
712 called with _ip.system and the pre-transformed command string.
707
713
708 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
714 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
709
715
710 * IPython/iplib.py (interact): Fix that we were not catching
716 * IPython/iplib.py (interact): Fix that we were not catching
711 KeyboardInterrupt exceptions properly. I'm not quite sure why the
717 KeyboardInterrupt exceptions properly. I'm not quite sure why the
712 logic here had to change, but it's fixed now.
718 logic here had to change, but it's fixed now.
713
719
714 2006-01-29 Ville Vainio <vivainio@gmail.com>
720 2006-01-29 Ville Vainio <vivainio@gmail.com>
715
721
716 * iplib.py: Try to import pyreadline on Windows.
722 * iplib.py: Try to import pyreadline on Windows.
717
723
718 2006-01-27 Ville Vainio <vivainio@gmail.com>
724 2006-01-27 Ville Vainio <vivainio@gmail.com>
719
725
720 * iplib.py: Expose ipapi as _ip in builtin namespace.
726 * iplib.py: Expose ipapi as _ip in builtin namespace.
721 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
727 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
722 and ip_set_hook (-> _ip.set_hook) redundant. % and !
728 and ip_set_hook (-> _ip.set_hook) redundant. % and !
723 syntax now produce _ip.* variant of the commands.
729 syntax now produce _ip.* variant of the commands.
724
730
725 * "_ip.options().autoedit_syntax = 2" automatically throws
731 * "_ip.options().autoedit_syntax = 2" automatically throws
726 user to editor for syntax error correction without prompting.
732 user to editor for syntax error correction without prompting.
727
733
728 2006-01-27 Ville Vainio <vivainio@gmail.com>
734 2006-01-27 Ville Vainio <vivainio@gmail.com>
729
735
730 * ipmaker.py: Give "realistic" sys.argv for scripts (without
736 * ipmaker.py: Give "realistic" sys.argv for scripts (without
731 'ipython' at argv[0]) executed through command line.
737 'ipython' at argv[0]) executed through command line.
732 NOTE: this DEPRECATES calling ipython with multiple scripts
738 NOTE: this DEPRECATES calling ipython with multiple scripts
733 ("ipython a.py b.py c.py")
739 ("ipython a.py b.py c.py")
734
740
735 * iplib.py, hooks.py: Added configurable input prefilter,
741 * iplib.py, hooks.py: Added configurable input prefilter,
736 named 'input_prefilter'. See ext_rescapture.py for example
742 named 'input_prefilter'. See ext_rescapture.py for example
737 usage.
743 usage.
738
744
739 * ext_rescapture.py, Magic.py: Better system command output capture
745 * ext_rescapture.py, Magic.py: Better system command output capture
740 through 'var = !ls' (deprecates user-visible %sc). Same notation
746 through 'var = !ls' (deprecates user-visible %sc). Same notation
741 applies for magics, 'var = %alias' assigns alias list to var.
747 applies for magics, 'var = %alias' assigns alias list to var.
742
748
743 * ipapi.py: added meta() for accessing extension-usable data store.
749 * ipapi.py: added meta() for accessing extension-usable data store.
744
750
745 * iplib.py: added InteractiveShell.getapi(). New magics should be
751 * iplib.py: added InteractiveShell.getapi(). New magics should be
746 written doing self.getapi() instead of using the shell directly.
752 written doing self.getapi() instead of using the shell directly.
747
753
748 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
754 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
749 %store foo >> ~/myfoo.txt to store variables to files (in clean
755 %store foo >> ~/myfoo.txt to store variables to files (in clean
750 textual form, not a restorable pickle).
756 textual form, not a restorable pickle).
751
757
752 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
758 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
753
759
754 * usage.py, Magic.py: added %quickref
760 * usage.py, Magic.py: added %quickref
755
761
756 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
762 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
757
763
758 * GetoptErrors when invoking magics etc. with wrong args
764 * GetoptErrors when invoking magics etc. with wrong args
759 are now more helpful:
765 are now more helpful:
760 GetoptError: option -l not recognized (allowed: "qb" )
766 GetoptError: option -l not recognized (allowed: "qb" )
761
767
762 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
768 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
763
769
764 * IPython/demo.py (Demo.show): Flush stdout after each block, so
770 * IPython/demo.py (Demo.show): Flush stdout after each block, so
765 computationally intensive blocks don't appear to stall the demo.
771 computationally intensive blocks don't appear to stall the demo.
766
772
767 2006-01-24 Ville Vainio <vivainio@gmail.com>
773 2006-01-24 Ville Vainio <vivainio@gmail.com>
768
774
769 * iplib.py, hooks.py: 'result_display' hook can return a non-None
775 * iplib.py, hooks.py: 'result_display' hook can return a non-None
770 value to manipulate resulting history entry.
776 value to manipulate resulting history entry.
771
777
772 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
778 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
773 to instance methods of IPApi class, to make extending an embedded
779 to instance methods of IPApi class, to make extending an embedded
774 IPython feasible. See ext_rehashdir.py for example usage.
780 IPython feasible. See ext_rehashdir.py for example usage.
775
781
776 * Merged 1071-1076 from branches/0.7.1
782 * Merged 1071-1076 from branches/0.7.1
777
783
778
784
779 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
785 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
780
786
781 * tools/release (daystamp): Fix build tools to use the new
787 * tools/release (daystamp): Fix build tools to use the new
782 eggsetup.py script to build lightweight eggs.
788 eggsetup.py script to build lightweight eggs.
783
789
784 * Applied changesets 1062 and 1064 before 0.7.1 release.
790 * Applied changesets 1062 and 1064 before 0.7.1 release.
785
791
786 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
792 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
787 see the raw input history (without conversions like %ls ->
793 see the raw input history (without conversions like %ls ->
788 ipmagic("ls")). After a request from W. Stein, SAGE
794 ipmagic("ls")). After a request from W. Stein, SAGE
789 (http://modular.ucsd.edu/sage) developer. This information is
795 (http://modular.ucsd.edu/sage) developer. This information is
790 stored in the input_hist_raw attribute of the IPython instance, so
796 stored in the input_hist_raw attribute of the IPython instance, so
791 developers can access it if needed (it's an InputList instance).
797 developers can access it if needed (it's an InputList instance).
792
798
793 * Versionstring = 0.7.2.svn
799 * Versionstring = 0.7.2.svn
794
800
795 * eggsetup.py: A separate script for constructing eggs, creates
801 * eggsetup.py: A separate script for constructing eggs, creates
796 proper launch scripts even on Windows (an .exe file in
802 proper launch scripts even on Windows (an .exe file in
797 \python24\scripts).
803 \python24\scripts).
798
804
799 * ipapi.py: launch_new_instance, launch entry point needed for the
805 * ipapi.py: launch_new_instance, launch entry point needed for the
800 egg.
806 egg.
801
807
802 2006-01-23 Ville Vainio <vivainio@gmail.com>
808 2006-01-23 Ville Vainio <vivainio@gmail.com>
803
809
804 * Added %cpaste magic for pasting python code
810 * Added %cpaste magic for pasting python code
805
811
806 2006-01-22 Ville Vainio <vivainio@gmail.com>
812 2006-01-22 Ville Vainio <vivainio@gmail.com>
807
813
808 * Merge from branches/0.7.1 into trunk, revs 1052-1057
814 * Merge from branches/0.7.1 into trunk, revs 1052-1057
809
815
810 * Versionstring = 0.7.2.svn
816 * Versionstring = 0.7.2.svn
811
817
812 * eggsetup.py: A separate script for constructing eggs, creates
818 * eggsetup.py: A separate script for constructing eggs, creates
813 proper launch scripts even on Windows (an .exe file in
819 proper launch scripts even on Windows (an .exe file in
814 \python24\scripts).
820 \python24\scripts).
815
821
816 * ipapi.py: launch_new_instance, launch entry point needed for the
822 * ipapi.py: launch_new_instance, launch entry point needed for the
817 egg.
823 egg.
818
824
819 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
825 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
820
826
821 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
827 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
822 %pfile foo would print the file for foo even if it was a binary.
828 %pfile foo would print the file for foo even if it was a binary.
823 Now, extensions '.so' and '.dll' are skipped.
829 Now, extensions '.so' and '.dll' are skipped.
824
830
825 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
831 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
826 bug, where macros would fail in all threaded modes. I'm not 100%
832 bug, where macros would fail in all threaded modes. I'm not 100%
827 sure, so I'm going to put out an rc instead of making a release
833 sure, so I'm going to put out an rc instead of making a release
828 today, and wait for feedback for at least a few days.
834 today, and wait for feedback for at least a few days.
829
835
830 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
836 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
831 it...) the handling of pasting external code with autoindent on.
837 it...) the handling of pasting external code with autoindent on.
832 To get out of a multiline input, the rule will appear for most
838 To get out of a multiline input, the rule will appear for most
833 users unchanged: two blank lines or change the indent level
839 users unchanged: two blank lines or change the indent level
834 proposed by IPython. But there is a twist now: you can
840 proposed by IPython. But there is a twist now: you can
835 add/subtract only *one or two spaces*. If you add/subtract three
841 add/subtract only *one or two spaces*. If you add/subtract three
836 or more (unless you completely delete the line), IPython will
842 or more (unless you completely delete the line), IPython will
837 accept that line, and you'll need to enter a second one of pure
843 accept that line, and you'll need to enter a second one of pure
838 whitespace. I know it sounds complicated, but I can't find a
844 whitespace. I know it sounds complicated, but I can't find a
839 different solution that covers all the cases, with the right
845 different solution that covers all the cases, with the right
840 heuristics. Hopefully in actual use, nobody will really notice
846 heuristics. Hopefully in actual use, nobody will really notice
841 all these strange rules and things will 'just work'.
847 all these strange rules and things will 'just work'.
842
848
843 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
849 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
844
850
845 * IPython/iplib.py (interact): catch exceptions which can be
851 * IPython/iplib.py (interact): catch exceptions which can be
846 triggered asynchronously by signal handlers. Thanks to an
852 triggered asynchronously by signal handlers. Thanks to an
847 automatic crash report, submitted by Colin Kingsley
853 automatic crash report, submitted by Colin Kingsley
848 <tercel-AT-gentoo.org>.
854 <tercel-AT-gentoo.org>.
849
855
850 2006-01-20 Ville Vainio <vivainio@gmail.com>
856 2006-01-20 Ville Vainio <vivainio@gmail.com>
851
857
852 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
858 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
853 (%rehashdir, very useful, try it out) of how to extend ipython
859 (%rehashdir, very useful, try it out) of how to extend ipython
854 with new magics. Also added Extensions dir to pythonpath to make
860 with new magics. Also added Extensions dir to pythonpath to make
855 importing extensions easy.
861 importing extensions easy.
856
862
857 * %store now complains when trying to store interactively declared
863 * %store now complains when trying to store interactively declared
858 classes / instances of those classes.
864 classes / instances of those classes.
859
865
860 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
866 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
861 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
867 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
862 if they exist, and ipy_user_conf.py with some defaults is created for
868 if they exist, and ipy_user_conf.py with some defaults is created for
863 the user.
869 the user.
864
870
865 * Startup rehashing done by the config file, not InterpreterExec.
871 * Startup rehashing done by the config file, not InterpreterExec.
866 This means system commands are available even without selecting the
872 This means system commands are available even without selecting the
867 pysh profile. It's the sensible default after all.
873 pysh profile. It's the sensible default after all.
868
874
869 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
875 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
870
876
871 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
877 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
872 multiline code with autoindent on working. But I am really not
878 multiline code with autoindent on working. But I am really not
873 sure, so this needs more testing. Will commit a debug-enabled
879 sure, so this needs more testing. Will commit a debug-enabled
874 version for now, while I test it some more, so that Ville and
880 version for now, while I test it some more, so that Ville and
875 others may also catch any problems. Also made
881 others may also catch any problems. Also made
876 self.indent_current_str() a method, to ensure that there's no
882 self.indent_current_str() a method, to ensure that there's no
877 chance of the indent space count and the corresponding string
883 chance of the indent space count and the corresponding string
878 falling out of sync. All code needing the string should just call
884 falling out of sync. All code needing the string should just call
879 the method.
885 the method.
880
886
881 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
887 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
882
888
883 * IPython/Magic.py (magic_edit): fix check for when users don't
889 * IPython/Magic.py (magic_edit): fix check for when users don't
884 save their output files, the try/except was in the wrong section.
890 save their output files, the try/except was in the wrong section.
885
891
886 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
892 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
887
893
888 * IPython/Magic.py (magic_run): fix __file__ global missing from
894 * IPython/Magic.py (magic_run): fix __file__ global missing from
889 script's namespace when executed via %run. After a report by
895 script's namespace when executed via %run. After a report by
890 Vivian.
896 Vivian.
891
897
892 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
898 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
893 when using python 2.4. The parent constructor changed in 2.4, and
899 when using python 2.4. The parent constructor changed in 2.4, and
894 we need to track it directly (we can't call it, as it messes up
900 we need to track it directly (we can't call it, as it messes up
895 readline and tab-completion inside our pdb would stop working).
901 readline and tab-completion inside our pdb would stop working).
896 After a bug report by R. Bernstein <rocky-AT-panix.com>.
902 After a bug report by R. Bernstein <rocky-AT-panix.com>.
897
903
898 2006-01-16 Ville Vainio <vivainio@gmail.com>
904 2006-01-16 Ville Vainio <vivainio@gmail.com>
899
905
900 * Ipython/magic.py: Reverted back to old %edit functionality
906 * Ipython/magic.py: Reverted back to old %edit functionality
901 that returns file contents on exit.
907 that returns file contents on exit.
902
908
903 * IPython/path.py: Added Jason Orendorff's "path" module to
909 * IPython/path.py: Added Jason Orendorff's "path" module to
904 IPython tree, http://www.jorendorff.com/articles/python/path/.
910 IPython tree, http://www.jorendorff.com/articles/python/path/.
905 You can get path objects conveniently through %sc, and !!, e.g.:
911 You can get path objects conveniently through %sc, and !!, e.g.:
906 sc files=ls
912 sc files=ls
907 for p in files.paths: # or files.p
913 for p in files.paths: # or files.p
908 print p,p.mtime
914 print p,p.mtime
909
915
910 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
916 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
911 now work again without considering the exclusion regexp -
917 now work again without considering the exclusion regexp -
912 hence, things like ',foo my/path' turn to 'foo("my/path")'
918 hence, things like ',foo my/path' turn to 'foo("my/path")'
913 instead of syntax error.
919 instead of syntax error.
914
920
915
921
916 2006-01-14 Ville Vainio <vivainio@gmail.com>
922 2006-01-14 Ville Vainio <vivainio@gmail.com>
917
923
918 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
924 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
919 ipapi decorators for python 2.4 users, options() provides access to rc
925 ipapi decorators for python 2.4 users, options() provides access to rc
920 data.
926 data.
921
927
922 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
928 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
923 as path separators (even on Linux ;-). Space character after
929 as path separators (even on Linux ;-). Space character after
924 backslash (as yielded by tab completer) is still space;
930 backslash (as yielded by tab completer) is still space;
925 "%cd long\ name" works as expected.
931 "%cd long\ name" works as expected.
926
932
927 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
933 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
928 as "chain of command", with priority. API stays the same,
934 as "chain of command", with priority. API stays the same,
929 TryNext exception raised by a hook function signals that
935 TryNext exception raised by a hook function signals that
930 current hook failed and next hook should try handling it, as
936 current hook failed and next hook should try handling it, as
931 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
937 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
932 requested configurable display hook, which is now implemented.
938 requested configurable display hook, which is now implemented.
933
939
934 2006-01-13 Ville Vainio <vivainio@gmail.com>
940 2006-01-13 Ville Vainio <vivainio@gmail.com>
935
941
936 * IPython/platutils*.py: platform specific utility functions,
942 * IPython/platutils*.py: platform specific utility functions,
937 so far only set_term_title is implemented (change terminal
943 so far only set_term_title is implemented (change terminal
938 label in windowing systems). %cd now changes the title to
944 label in windowing systems). %cd now changes the title to
939 current dir.
945 current dir.
940
946
941 * IPython/Release.py: Added myself to "authors" list,
947 * IPython/Release.py: Added myself to "authors" list,
942 had to create new files.
948 had to create new files.
943
949
944 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
950 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
945 shell escape; not a known bug but had potential to be one in the
951 shell escape; not a known bug but had potential to be one in the
946 future.
952 future.
947
953
948 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
954 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
949 extension API for IPython! See the module for usage example. Fix
955 extension API for IPython! See the module for usage example. Fix
950 OInspect for docstring-less magic functions.
956 OInspect for docstring-less magic functions.
951
957
952
958
953 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
959 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
954
960
955 * IPython/iplib.py (raw_input): temporarily deactivate all
961 * IPython/iplib.py (raw_input): temporarily deactivate all
956 attempts at allowing pasting of code with autoindent on. It
962 attempts at allowing pasting of code with autoindent on. It
957 introduced bugs (reported by Prabhu) and I can't seem to find a
963 introduced bugs (reported by Prabhu) and I can't seem to find a
958 robust combination which works in all cases. Will have to revisit
964 robust combination which works in all cases. Will have to revisit
959 later.
965 later.
960
966
961 * IPython/genutils.py: remove isspace() function. We've dropped
967 * IPython/genutils.py: remove isspace() function. We've dropped
962 2.2 compatibility, so it's OK to use the string method.
968 2.2 compatibility, so it's OK to use the string method.
963
969
964 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
970 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
965
971
966 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
972 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
967 matching what NOT to autocall on, to include all python binary
973 matching what NOT to autocall on, to include all python binary
968 operators (including things like 'and', 'or', 'is' and 'in').
974 operators (including things like 'and', 'or', 'is' and 'in').
969 Prompted by a bug report on 'foo & bar', but I realized we had
975 Prompted by a bug report on 'foo & bar', but I realized we had
970 many more potential bug cases with other operators. The regexp is
976 many more potential bug cases with other operators. The regexp is
971 self.re_exclude_auto, it's fairly commented.
977 self.re_exclude_auto, it's fairly commented.
972
978
973 2006-01-12 Ville Vainio <vivainio@gmail.com>
979 2006-01-12 Ville Vainio <vivainio@gmail.com>
974
980
975 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
981 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
976 Prettified and hardened string/backslash quoting with ipsystem(),
982 Prettified and hardened string/backslash quoting with ipsystem(),
977 ipalias() and ipmagic(). Now even \ characters are passed to
983 ipalias() and ipmagic(). Now even \ characters are passed to
978 %magics, !shell escapes and aliases exactly as they are in the
984 %magics, !shell escapes and aliases exactly as they are in the
979 ipython command line. Should improve backslash experience,
985 ipython command line. Should improve backslash experience,
980 particularly in Windows (path delimiter for some commands that
986 particularly in Windows (path delimiter for some commands that
981 won't understand '/'), but Unix benefits as well (regexps). %cd
987 won't understand '/'), but Unix benefits as well (regexps). %cd
982 magic still doesn't support backslash path delimiters, though. Also
988 magic still doesn't support backslash path delimiters, though. Also
983 deleted all pretense of supporting multiline command strings in
989 deleted all pretense of supporting multiline command strings in
984 !system or %magic commands. Thanks to Jerry McRae for suggestions.
990 !system or %magic commands. Thanks to Jerry McRae for suggestions.
985
991
986 * doc/build_doc_instructions.txt added. Documentation on how to
992 * doc/build_doc_instructions.txt added. Documentation on how to
987 use doc/update_manual.py, added yesterday. Both files contributed
993 use doc/update_manual.py, added yesterday. Both files contributed
988 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
994 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
989 doc/*.sh for deprecation at a later date.
995 doc/*.sh for deprecation at a later date.
990
996
991 * /ipython.py Added ipython.py to root directory for
997 * /ipython.py Added ipython.py to root directory for
992 zero-installation (tar xzvf ipython.tgz; cd ipython; python
998 zero-installation (tar xzvf ipython.tgz; cd ipython; python
993 ipython.py) and development convenience (no need to keep doing
999 ipython.py) and development convenience (no need to keep doing
994 "setup.py install" between changes).
1000 "setup.py install" between changes).
995
1001
996 * Made ! and !! shell escapes work (again) in multiline expressions:
1002 * Made ! and !! shell escapes work (again) in multiline expressions:
997 if 1:
1003 if 1:
998 !ls
1004 !ls
999 !!ls
1005 !!ls
1000
1006
1001 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1007 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1002
1008
1003 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1009 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1004 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1010 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1005 module in case-insensitive installation. Was causing crashes
1011 module in case-insensitive installation. Was causing crashes
1006 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1012 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1007
1013
1008 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1014 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1009 <marienz-AT-gentoo.org>, closes
1015 <marienz-AT-gentoo.org>, closes
1010 http://www.scipy.net/roundup/ipython/issue51.
1016 http://www.scipy.net/roundup/ipython/issue51.
1011
1017
1012 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1018 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1013
1019
1014 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1020 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1015 problem of excessive CPU usage under *nix and keyboard lag under
1021 problem of excessive CPU usage under *nix and keyboard lag under
1016 win32.
1022 win32.
1017
1023
1018 2006-01-10 *** Released version 0.7.0
1024 2006-01-10 *** Released version 0.7.0
1019
1025
1020 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1026 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1021
1027
1022 * IPython/Release.py (revision): tag version number to 0.7.0,
1028 * IPython/Release.py (revision): tag version number to 0.7.0,
1023 ready for release.
1029 ready for release.
1024
1030
1025 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1031 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1026 it informs the user of the name of the temp. file used. This can
1032 it informs the user of the name of the temp. file used. This can
1027 help if you decide later to reuse that same file, so you know
1033 help if you decide later to reuse that same file, so you know
1028 where to copy the info from.
1034 where to copy the info from.
1029
1035
1030 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1036 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1031
1037
1032 * setup_bdist_egg.py: little script to build an egg. Added
1038 * setup_bdist_egg.py: little script to build an egg. Added
1033 support in the release tools as well.
1039 support in the release tools as well.
1034
1040
1035 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1041 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1036
1042
1037 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1043 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1038 version selection (new -wxversion command line and ipythonrc
1044 version selection (new -wxversion command line and ipythonrc
1039 parameter). Patch contributed by Arnd Baecker
1045 parameter). Patch contributed by Arnd Baecker
1040 <arnd.baecker-AT-web.de>.
1046 <arnd.baecker-AT-web.de>.
1041
1047
1042 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1048 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1043 embedded instances, for variables defined at the interactive
1049 embedded instances, for variables defined at the interactive
1044 prompt of the embedded ipython. Reported by Arnd.
1050 prompt of the embedded ipython. Reported by Arnd.
1045
1051
1046 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1052 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1047 it can be used as a (stateful) toggle, or with a direct parameter.
1053 it can be used as a (stateful) toggle, or with a direct parameter.
1048
1054
1049 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1055 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1050 could be triggered in certain cases and cause the traceback
1056 could be triggered in certain cases and cause the traceback
1051 printer not to work.
1057 printer not to work.
1052
1058
1053 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1059 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1054
1060
1055 * IPython/iplib.py (_should_recompile): Small fix, closes
1061 * IPython/iplib.py (_should_recompile): Small fix, closes
1056 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1062 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1057
1063
1058 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1064 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1059
1065
1060 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1066 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1061 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1067 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1062 Moad for help with tracking it down.
1068 Moad for help with tracking it down.
1063
1069
1064 * IPython/iplib.py (handle_auto): fix autocall handling for
1070 * IPython/iplib.py (handle_auto): fix autocall handling for
1065 objects which support BOTH __getitem__ and __call__ (so that f [x]
1071 objects which support BOTH __getitem__ and __call__ (so that f [x]
1066 is left alone, instead of becoming f([x]) automatically).
1072 is left alone, instead of becoming f([x]) automatically).
1067
1073
1068 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1074 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1069 Ville's patch.
1075 Ville's patch.
1070
1076
1071 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1077 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1072
1078
1073 * IPython/iplib.py (handle_auto): changed autocall semantics to
1079 * IPython/iplib.py (handle_auto): changed autocall semantics to
1074 include 'smart' mode, where the autocall transformation is NOT
1080 include 'smart' mode, where the autocall transformation is NOT
1075 applied if there are no arguments on the line. This allows you to
1081 applied if there are no arguments on the line. This allows you to
1076 just type 'foo' if foo is a callable to see its internal form,
1082 just type 'foo' if foo is a callable to see its internal form,
1077 instead of having it called with no arguments (typically a
1083 instead of having it called with no arguments (typically a
1078 mistake). The old 'full' autocall still exists: for that, you
1084 mistake). The old 'full' autocall still exists: for that, you
1079 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1085 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1080
1086
1081 * IPython/completer.py (Completer.attr_matches): add
1087 * IPython/completer.py (Completer.attr_matches): add
1082 tab-completion support for Enthoughts' traits. After a report by
1088 tab-completion support for Enthoughts' traits. After a report by
1083 Arnd and a patch by Prabhu.
1089 Arnd and a patch by Prabhu.
1084
1090
1085 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1091 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1086
1092
1087 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1093 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1088 Schmolck's patch to fix inspect.getinnerframes().
1094 Schmolck's patch to fix inspect.getinnerframes().
1089
1095
1090 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1096 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1091 for embedded instances, regarding handling of namespaces and items
1097 for embedded instances, regarding handling of namespaces and items
1092 added to the __builtin__ one. Multiple embedded instances and
1098 added to the __builtin__ one. Multiple embedded instances and
1093 recursive embeddings should work better now (though I'm not sure
1099 recursive embeddings should work better now (though I'm not sure
1094 I've got all the corner cases fixed, that code is a bit of a brain
1100 I've got all the corner cases fixed, that code is a bit of a brain
1095 twister).
1101 twister).
1096
1102
1097 * IPython/Magic.py (magic_edit): added support to edit in-memory
1103 * IPython/Magic.py (magic_edit): added support to edit in-memory
1098 macros (automatically creates the necessary temp files). %edit
1104 macros (automatically creates the necessary temp files). %edit
1099 also doesn't return the file contents anymore, it's just noise.
1105 also doesn't return the file contents anymore, it's just noise.
1100
1106
1101 * IPython/completer.py (Completer.attr_matches): revert change to
1107 * IPython/completer.py (Completer.attr_matches): revert change to
1102 complete only on attributes listed in __all__. I realized it
1108 complete only on attributes listed in __all__. I realized it
1103 cripples the tab-completion system as a tool for exploring the
1109 cripples the tab-completion system as a tool for exploring the
1104 internals of unknown libraries (it renders any non-__all__
1110 internals of unknown libraries (it renders any non-__all__
1105 attribute off-limits). I got bit by this when trying to see
1111 attribute off-limits). I got bit by this when trying to see
1106 something inside the dis module.
1112 something inside the dis module.
1107
1113
1108 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1114 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1109
1115
1110 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1116 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1111 namespace for users and extension writers to hold data in. This
1117 namespace for users and extension writers to hold data in. This
1112 follows the discussion in
1118 follows the discussion in
1113 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1119 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1114
1120
1115 * IPython/completer.py (IPCompleter.complete): small patch to help
1121 * IPython/completer.py (IPCompleter.complete): small patch to help
1116 tab-completion under Emacs, after a suggestion by John Barnard
1122 tab-completion under Emacs, after a suggestion by John Barnard
1117 <barnarj-AT-ccf.org>.
1123 <barnarj-AT-ccf.org>.
1118
1124
1119 * IPython/Magic.py (Magic.extract_input_slices): added support for
1125 * IPython/Magic.py (Magic.extract_input_slices): added support for
1120 the slice notation in magics to use N-M to represent numbers N...M
1126 the slice notation in magics to use N-M to represent numbers N...M
1121 (closed endpoints). This is used by %macro and %save.
1127 (closed endpoints). This is used by %macro and %save.
1122
1128
1123 * IPython/completer.py (Completer.attr_matches): for modules which
1129 * IPython/completer.py (Completer.attr_matches): for modules which
1124 define __all__, complete only on those. After a patch by Jeffrey
1130 define __all__, complete only on those. After a patch by Jeffrey
1125 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1131 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1126 speed up this routine.
1132 speed up this routine.
1127
1133
1128 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1134 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1129 don't know if this is the end of it, but the behavior now is
1135 don't know if this is the end of it, but the behavior now is
1130 certainly much more correct. Note that coupled with macros,
1136 certainly much more correct. Note that coupled with macros,
1131 slightly surprising (at first) behavior may occur: a macro will in
1137 slightly surprising (at first) behavior may occur: a macro will in
1132 general expand to multiple lines of input, so upon exiting, the
1138 general expand to multiple lines of input, so upon exiting, the
1133 in/out counters will both be bumped by the corresponding amount
1139 in/out counters will both be bumped by the corresponding amount
1134 (as if the macro's contents had been typed interactively). Typing
1140 (as if the macro's contents had been typed interactively). Typing
1135 %hist will reveal the intermediate (silently processed) lines.
1141 %hist will reveal the intermediate (silently processed) lines.
1136
1142
1137 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1143 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1138 pickle to fail (%run was overwriting __main__ and not restoring
1144 pickle to fail (%run was overwriting __main__ and not restoring
1139 it, but pickle relies on __main__ to operate).
1145 it, but pickle relies on __main__ to operate).
1140
1146
1141 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1147 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1142 using properties, but forgot to make the main InteractiveShell
1148 using properties, but forgot to make the main InteractiveShell
1143 class a new-style class. Properties fail silently, and
1149 class a new-style class. Properties fail silently, and
1144 mysteriously, with old-style class (getters work, but
1150 mysteriously, with old-style class (getters work, but
1145 setters don't do anything).
1151 setters don't do anything).
1146
1152
1147 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1153 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1148
1154
1149 * IPython/Magic.py (magic_history): fix history reporting bug (I
1155 * IPython/Magic.py (magic_history): fix history reporting bug (I
1150 know some nasties are still there, I just can't seem to find a
1156 know some nasties are still there, I just can't seem to find a
1151 reproducible test case to track them down; the input history is
1157 reproducible test case to track them down; the input history is
1152 falling out of sync...)
1158 falling out of sync...)
1153
1159
1154 * IPython/iplib.py (handle_shell_escape): fix bug where both
1160 * IPython/iplib.py (handle_shell_escape): fix bug where both
1155 aliases and system accesses where broken for indented code (such
1161 aliases and system accesses where broken for indented code (such
1156 as loops).
1162 as loops).
1157
1163
1158 * IPython/genutils.py (shell): fix small but critical bug for
1164 * IPython/genutils.py (shell): fix small but critical bug for
1159 win32 system access.
1165 win32 system access.
1160
1166
1161 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1167 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1162
1168
1163 * IPython/iplib.py (showtraceback): remove use of the
1169 * IPython/iplib.py (showtraceback): remove use of the
1164 sys.last_{type/value/traceback} structures, which are non
1170 sys.last_{type/value/traceback} structures, which are non
1165 thread-safe.
1171 thread-safe.
1166 (_prefilter): change control flow to ensure that we NEVER
1172 (_prefilter): change control flow to ensure that we NEVER
1167 introspect objects when autocall is off. This will guarantee that
1173 introspect objects when autocall is off. This will guarantee that
1168 having an input line of the form 'x.y', where access to attribute
1174 having an input line of the form 'x.y', where access to attribute
1169 'y' has side effects, doesn't trigger the side effect TWICE. It
1175 'y' has side effects, doesn't trigger the side effect TWICE. It
1170 is important to note that, with autocall on, these side effects
1176 is important to note that, with autocall on, these side effects
1171 can still happen.
1177 can still happen.
1172 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1178 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1173 trio. IPython offers these three kinds of special calls which are
1179 trio. IPython offers these three kinds of special calls which are
1174 not python code, and it's a good thing to have their call method
1180 not python code, and it's a good thing to have their call method
1175 be accessible as pure python functions (not just special syntax at
1181 be accessible as pure python functions (not just special syntax at
1176 the command line). It gives us a better internal implementation
1182 the command line). It gives us a better internal implementation
1177 structure, as well as exposing these for user scripting more
1183 structure, as well as exposing these for user scripting more
1178 cleanly.
1184 cleanly.
1179
1185
1180 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1186 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1181 file. Now that they'll be more likely to be used with the
1187 file. Now that they'll be more likely to be used with the
1182 persistance system (%store), I want to make sure their module path
1188 persistance system (%store), I want to make sure their module path
1183 doesn't change in the future, so that we don't break things for
1189 doesn't change in the future, so that we don't break things for
1184 users' persisted data.
1190 users' persisted data.
1185
1191
1186 * IPython/iplib.py (autoindent_update): move indentation
1192 * IPython/iplib.py (autoindent_update): move indentation
1187 management into the _text_ processing loop, not the keyboard
1193 management into the _text_ processing loop, not the keyboard
1188 interactive one. This is necessary to correctly process non-typed
1194 interactive one. This is necessary to correctly process non-typed
1189 multiline input (such as macros).
1195 multiline input (such as macros).
1190
1196
1191 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1197 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1192 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1198 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1193 which was producing problems in the resulting manual.
1199 which was producing problems in the resulting manual.
1194 (magic_whos): improve reporting of instances (show their class,
1200 (magic_whos): improve reporting of instances (show their class,
1195 instead of simply printing 'instance' which isn't terribly
1201 instead of simply printing 'instance' which isn't terribly
1196 informative).
1202 informative).
1197
1203
1198 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1204 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1199 (minor mods) to support network shares under win32.
1205 (minor mods) to support network shares under win32.
1200
1206
1201 * IPython/winconsole.py (get_console_size): add new winconsole
1207 * IPython/winconsole.py (get_console_size): add new winconsole
1202 module and fixes to page_dumb() to improve its behavior under
1208 module and fixes to page_dumb() to improve its behavior under
1203 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1209 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1204
1210
1205 * IPython/Magic.py (Macro): simplified Macro class to just
1211 * IPython/Magic.py (Macro): simplified Macro class to just
1206 subclass list. We've had only 2.2 compatibility for a very long
1212 subclass list. We've had only 2.2 compatibility for a very long
1207 time, yet I was still avoiding subclassing the builtin types. No
1213 time, yet I was still avoiding subclassing the builtin types. No
1208 more (I'm also starting to use properties, though I won't shift to
1214 more (I'm also starting to use properties, though I won't shift to
1209 2.3-specific features quite yet).
1215 2.3-specific features quite yet).
1210 (magic_store): added Ville's patch for lightweight variable
1216 (magic_store): added Ville's patch for lightweight variable
1211 persistence, after a request on the user list by Matt Wilkie
1217 persistence, after a request on the user list by Matt Wilkie
1212 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1218 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1213 details.
1219 details.
1214
1220
1215 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1221 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1216 changed the default logfile name from 'ipython.log' to
1222 changed the default logfile name from 'ipython.log' to
1217 'ipython_log.py'. These logs are real python files, and now that
1223 'ipython_log.py'. These logs are real python files, and now that
1218 we have much better multiline support, people are more likely to
1224 we have much better multiline support, people are more likely to
1219 want to use them as such. Might as well name them correctly.
1225 want to use them as such. Might as well name them correctly.
1220
1226
1221 * IPython/Magic.py: substantial cleanup. While we can't stop
1227 * IPython/Magic.py: substantial cleanup. While we can't stop
1222 using magics as mixins, due to the existing customizations 'out
1228 using magics as mixins, due to the existing customizations 'out
1223 there' which rely on the mixin naming conventions, at least I
1229 there' which rely on the mixin naming conventions, at least I
1224 cleaned out all cross-class name usage. So once we are OK with
1230 cleaned out all cross-class name usage. So once we are OK with
1225 breaking compatibility, the two systems can be separated.
1231 breaking compatibility, the two systems can be separated.
1226
1232
1227 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1233 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1228 anymore, and the class is a fair bit less hideous as well. New
1234 anymore, and the class is a fair bit less hideous as well. New
1229 features were also introduced: timestamping of input, and logging
1235 features were also introduced: timestamping of input, and logging
1230 of output results. These are user-visible with the -t and -o
1236 of output results. These are user-visible with the -t and -o
1231 options to %logstart. Closes
1237 options to %logstart. Closes
1232 http://www.scipy.net/roundup/ipython/issue11 and a request by
1238 http://www.scipy.net/roundup/ipython/issue11 and a request by
1233 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1239 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1234
1240
1235 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1241 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1236
1242
1237 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1243 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1238 better handle backslashes in paths. See the thread 'More Windows
1244 better handle backslashes in paths. See the thread 'More Windows
1239 questions part 2 - \/ characters revisited' on the iypthon user
1245 questions part 2 - \/ characters revisited' on the iypthon user
1240 list:
1246 list:
1241 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1247 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1242
1248
1243 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1249 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1244
1250
1245 (InteractiveShell.__init__): change threaded shells to not use the
1251 (InteractiveShell.__init__): change threaded shells to not use the
1246 ipython crash handler. This was causing more problems than not,
1252 ipython crash handler. This was causing more problems than not,
1247 as exceptions in the main thread (GUI code, typically) would
1253 as exceptions in the main thread (GUI code, typically) would
1248 always show up as a 'crash', when they really weren't.
1254 always show up as a 'crash', when they really weren't.
1249
1255
1250 The colors and exception mode commands (%colors/%xmode) have been
1256 The colors and exception mode commands (%colors/%xmode) have been
1251 synchronized to also take this into account, so users can get
1257 synchronized to also take this into account, so users can get
1252 verbose exceptions for their threaded code as well. I also added
1258 verbose exceptions for their threaded code as well. I also added
1253 support for activating pdb inside this exception handler as well,
1259 support for activating pdb inside this exception handler as well,
1254 so now GUI authors can use IPython's enhanced pdb at runtime.
1260 so now GUI authors can use IPython's enhanced pdb at runtime.
1255
1261
1256 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1262 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1257 true by default, and add it to the shipped ipythonrc file. Since
1263 true by default, and add it to the shipped ipythonrc file. Since
1258 this asks the user before proceeding, I think it's OK to make it
1264 this asks the user before proceeding, I think it's OK to make it
1259 true by default.
1265 true by default.
1260
1266
1261 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1267 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1262 of the previous special-casing of input in the eval loop. I think
1268 of the previous special-casing of input in the eval loop. I think
1263 this is cleaner, as they really are commands and shouldn't have
1269 this is cleaner, as they really are commands and shouldn't have
1264 a special role in the middle of the core code.
1270 a special role in the middle of the core code.
1265
1271
1266 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1272 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1267
1273
1268 * IPython/iplib.py (edit_syntax_error): added support for
1274 * IPython/iplib.py (edit_syntax_error): added support for
1269 automatically reopening the editor if the file had a syntax error
1275 automatically reopening the editor if the file had a syntax error
1270 in it. Thanks to scottt who provided the patch at:
1276 in it. Thanks to scottt who provided the patch at:
1271 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1277 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1272 version committed).
1278 version committed).
1273
1279
1274 * IPython/iplib.py (handle_normal): add suport for multi-line
1280 * IPython/iplib.py (handle_normal): add suport for multi-line
1275 input with emtpy lines. This fixes
1281 input with emtpy lines. This fixes
1276 http://www.scipy.net/roundup/ipython/issue43 and a similar
1282 http://www.scipy.net/roundup/ipython/issue43 and a similar
1277 discussion on the user list.
1283 discussion on the user list.
1278
1284
1279 WARNING: a behavior change is necessarily introduced to support
1285 WARNING: a behavior change is necessarily introduced to support
1280 blank lines: now a single blank line with whitespace does NOT
1286 blank lines: now a single blank line with whitespace does NOT
1281 break the input loop, which means that when autoindent is on, by
1287 break the input loop, which means that when autoindent is on, by
1282 default hitting return on the next (indented) line does NOT exit.
1288 default hitting return on the next (indented) line does NOT exit.
1283
1289
1284 Instead, to exit a multiline input you can either have:
1290 Instead, to exit a multiline input you can either have:
1285
1291
1286 - TWO whitespace lines (just hit return again), or
1292 - TWO whitespace lines (just hit return again), or
1287 - a single whitespace line of a different length than provided
1293 - a single whitespace line of a different length than provided
1288 by the autoindent (add or remove a space).
1294 by the autoindent (add or remove a space).
1289
1295
1290 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1296 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1291 module to better organize all readline-related functionality.
1297 module to better organize all readline-related functionality.
1292 I've deleted FlexCompleter and put all completion clases here.
1298 I've deleted FlexCompleter and put all completion clases here.
1293
1299
1294 * IPython/iplib.py (raw_input): improve indentation management.
1300 * IPython/iplib.py (raw_input): improve indentation management.
1295 It is now possible to paste indented code with autoindent on, and
1301 It is now possible to paste indented code with autoindent on, and
1296 the code is interpreted correctly (though it still looks bad on
1302 the code is interpreted correctly (though it still looks bad on
1297 screen, due to the line-oriented nature of ipython).
1303 screen, due to the line-oriented nature of ipython).
1298 (MagicCompleter.complete): change behavior so that a TAB key on an
1304 (MagicCompleter.complete): change behavior so that a TAB key on an
1299 otherwise empty line actually inserts a tab, instead of completing
1305 otherwise empty line actually inserts a tab, instead of completing
1300 on the entire global namespace. This makes it easier to use the
1306 on the entire global namespace. This makes it easier to use the
1301 TAB key for indentation. After a request by Hans Meine
1307 TAB key for indentation. After a request by Hans Meine
1302 <hans_meine-AT-gmx.net>
1308 <hans_meine-AT-gmx.net>
1303 (_prefilter): add support so that typing plain 'exit' or 'quit'
1309 (_prefilter): add support so that typing plain 'exit' or 'quit'
1304 does a sensible thing. Originally I tried to deviate as little as
1310 does a sensible thing. Originally I tried to deviate as little as
1305 possible from the default python behavior, but even that one may
1311 possible from the default python behavior, but even that one may
1306 change in this direction (thread on python-dev to that effect).
1312 change in this direction (thread on python-dev to that effect).
1307 Regardless, ipython should do the right thing even if CPython's
1313 Regardless, ipython should do the right thing even if CPython's
1308 '>>>' prompt doesn't.
1314 '>>>' prompt doesn't.
1309 (InteractiveShell): removed subclassing code.InteractiveConsole
1315 (InteractiveShell): removed subclassing code.InteractiveConsole
1310 class. By now we'd overridden just about all of its methods: I've
1316 class. By now we'd overridden just about all of its methods: I've
1311 copied the remaining two over, and now ipython is a standalone
1317 copied the remaining two over, and now ipython is a standalone
1312 class. This will provide a clearer picture for the chainsaw
1318 class. This will provide a clearer picture for the chainsaw
1313 branch refactoring.
1319 branch refactoring.
1314
1320
1315 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1321 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1316
1322
1317 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1323 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1318 failures for objects which break when dir() is called on them.
1324 failures for objects which break when dir() is called on them.
1319
1325
1320 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1326 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1321 distinct local and global namespaces in the completer API. This
1327 distinct local and global namespaces in the completer API. This
1322 change allows us to properly handle completion with distinct
1328 change allows us to properly handle completion with distinct
1323 scopes, including in embedded instances (this had never really
1329 scopes, including in embedded instances (this had never really
1324 worked correctly).
1330 worked correctly).
1325
1331
1326 Note: this introduces a change in the constructor for
1332 Note: this introduces a change in the constructor for
1327 MagicCompleter, as a new global_namespace parameter is now the
1333 MagicCompleter, as a new global_namespace parameter is now the
1328 second argument (the others were bumped one position).
1334 second argument (the others were bumped one position).
1329
1335
1330 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1336 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1331
1337
1332 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1338 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1333 embedded instances (which can be done now thanks to Vivian's
1339 embedded instances (which can be done now thanks to Vivian's
1334 frame-handling fixes for pdb).
1340 frame-handling fixes for pdb).
1335 (InteractiveShell.__init__): Fix namespace handling problem in
1341 (InteractiveShell.__init__): Fix namespace handling problem in
1336 embedded instances. We were overwriting __main__ unconditionally,
1342 embedded instances. We were overwriting __main__ unconditionally,
1337 and this should only be done for 'full' (non-embedded) IPython;
1343 and this should only be done for 'full' (non-embedded) IPython;
1338 embedded instances must respect the caller's __main__. Thanks to
1344 embedded instances must respect the caller's __main__. Thanks to
1339 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1345 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1340
1346
1341 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1347 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1342
1348
1343 * setup.py: added download_url to setup(). This registers the
1349 * setup.py: added download_url to setup(). This registers the
1344 download address at PyPI, which is not only useful to humans
1350 download address at PyPI, which is not only useful to humans
1345 browsing the site, but is also picked up by setuptools (the Eggs
1351 browsing the site, but is also picked up by setuptools (the Eggs
1346 machinery). Thanks to Ville and R. Kern for the info/discussion
1352 machinery). Thanks to Ville and R. Kern for the info/discussion
1347 on this.
1353 on this.
1348
1354
1349 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1355 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1350
1356
1351 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1357 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1352 This brings a lot of nice functionality to the pdb mode, which now
1358 This brings a lot of nice functionality to the pdb mode, which now
1353 has tab-completion, syntax highlighting, and better stack handling
1359 has tab-completion, syntax highlighting, and better stack handling
1354 than before. Many thanks to Vivian De Smedt
1360 than before. Many thanks to Vivian De Smedt
1355 <vivian-AT-vdesmedt.com> for the original patches.
1361 <vivian-AT-vdesmedt.com> for the original patches.
1356
1362
1357 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1363 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1358
1364
1359 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1365 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1360 sequence to consistently accept the banner argument. The
1366 sequence to consistently accept the banner argument. The
1361 inconsistency was tripping SAGE, thanks to Gary Zablackis
1367 inconsistency was tripping SAGE, thanks to Gary Zablackis
1362 <gzabl-AT-yahoo.com> for the report.
1368 <gzabl-AT-yahoo.com> for the report.
1363
1369
1364 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1370 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1365
1371
1366 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1372 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1367 Fix bug where a naked 'alias' call in the ipythonrc file would
1373 Fix bug where a naked 'alias' call in the ipythonrc file would
1368 cause a crash. Bug reported by Jorgen Stenarson.
1374 cause a crash. Bug reported by Jorgen Stenarson.
1369
1375
1370 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1376 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1371
1377
1372 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1378 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1373 startup time.
1379 startup time.
1374
1380
1375 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1381 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1376 instances had introduced a bug with globals in normal code. Now
1382 instances had introduced a bug with globals in normal code. Now
1377 it's working in all cases.
1383 it's working in all cases.
1378
1384
1379 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1385 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1380 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1386 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1381 has been introduced to set the default case sensitivity of the
1387 has been introduced to set the default case sensitivity of the
1382 searches. Users can still select either mode at runtime on a
1388 searches. Users can still select either mode at runtime on a
1383 per-search basis.
1389 per-search basis.
1384
1390
1385 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1391 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1386
1392
1387 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1393 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1388 attributes in wildcard searches for subclasses. Modified version
1394 attributes in wildcard searches for subclasses. Modified version
1389 of a patch by Jorgen.
1395 of a patch by Jorgen.
1390
1396
1391 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1397 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1392
1398
1393 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1399 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1394 embedded instances. I added a user_global_ns attribute to the
1400 embedded instances. I added a user_global_ns attribute to the
1395 InteractiveShell class to handle this.
1401 InteractiveShell class to handle this.
1396
1402
1397 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1403 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1398
1404
1399 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1405 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1400 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1406 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1401 (reported under win32, but may happen also in other platforms).
1407 (reported under win32, but may happen also in other platforms).
1402 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1408 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1403
1409
1404 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1410 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1405
1411
1406 * IPython/Magic.py (magic_psearch): new support for wildcard
1412 * IPython/Magic.py (magic_psearch): new support for wildcard
1407 patterns. Now, typing ?a*b will list all names which begin with a
1413 patterns. Now, typing ?a*b will list all names which begin with a
1408 and end in b, for example. The %psearch magic has full
1414 and end in b, for example. The %psearch magic has full
1409 docstrings. Many thanks to JΓΆrgen Stenarson
1415 docstrings. Many thanks to JΓΆrgen Stenarson
1410 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1416 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1411 implementing this functionality.
1417 implementing this functionality.
1412
1418
1413 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1419 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1414
1420
1415 * Manual: fixed long-standing annoyance of double-dashes (as in
1421 * Manual: fixed long-standing annoyance of double-dashes (as in
1416 --prefix=~, for example) being stripped in the HTML version. This
1422 --prefix=~, for example) being stripped in the HTML version. This
1417 is a latex2html bug, but a workaround was provided. Many thanks
1423 is a latex2html bug, but a workaround was provided. Many thanks
1418 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1424 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1419 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1425 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1420 rolling. This seemingly small issue had tripped a number of users
1426 rolling. This seemingly small issue had tripped a number of users
1421 when first installing, so I'm glad to see it gone.
1427 when first installing, so I'm glad to see it gone.
1422
1428
1423 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1429 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1424
1430
1425 * IPython/Extensions/numeric_formats.py: fix missing import,
1431 * IPython/Extensions/numeric_formats.py: fix missing import,
1426 reported by Stephen Walton.
1432 reported by Stephen Walton.
1427
1433
1428 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1434 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1429
1435
1430 * IPython/demo.py: finish demo module, fully documented now.
1436 * IPython/demo.py: finish demo module, fully documented now.
1431
1437
1432 * IPython/genutils.py (file_read): simple little utility to read a
1438 * IPython/genutils.py (file_read): simple little utility to read a
1433 file and ensure it's closed afterwards.
1439 file and ensure it's closed afterwards.
1434
1440
1435 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1441 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1436
1442
1437 * IPython/demo.py (Demo.__init__): added support for individually
1443 * IPython/demo.py (Demo.__init__): added support for individually
1438 tagging blocks for automatic execution.
1444 tagging blocks for automatic execution.
1439
1445
1440 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1446 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1441 syntax-highlighted python sources, requested by John.
1447 syntax-highlighted python sources, requested by John.
1442
1448
1443 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1449 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1444
1450
1445 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1451 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1446 finishing.
1452 finishing.
1447
1453
1448 * IPython/genutils.py (shlex_split): moved from Magic to here,
1454 * IPython/genutils.py (shlex_split): moved from Magic to here,
1449 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1455 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1450
1456
1451 * IPython/demo.py (Demo.__init__): added support for silent
1457 * IPython/demo.py (Demo.__init__): added support for silent
1452 blocks, improved marks as regexps, docstrings written.
1458 blocks, improved marks as regexps, docstrings written.
1453 (Demo.__init__): better docstring, added support for sys.argv.
1459 (Demo.__init__): better docstring, added support for sys.argv.
1454
1460
1455 * IPython/genutils.py (marquee): little utility used by the demo
1461 * IPython/genutils.py (marquee): little utility used by the demo
1456 code, handy in general.
1462 code, handy in general.
1457
1463
1458 * IPython/demo.py (Demo.__init__): new class for interactive
1464 * IPython/demo.py (Demo.__init__): new class for interactive
1459 demos. Not documented yet, I just wrote it in a hurry for
1465 demos. Not documented yet, I just wrote it in a hurry for
1460 scipy'05. Will docstring later.
1466 scipy'05. Will docstring later.
1461
1467
1462 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1468 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1463
1469
1464 * IPython/Shell.py (sigint_handler): Drastic simplification which
1470 * IPython/Shell.py (sigint_handler): Drastic simplification which
1465 also seems to make Ctrl-C work correctly across threads! This is
1471 also seems to make Ctrl-C work correctly across threads! This is
1466 so simple, that I can't beleive I'd missed it before. Needs more
1472 so simple, that I can't beleive I'd missed it before. Needs more
1467 testing, though.
1473 testing, though.
1468 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1474 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1469 like this before...
1475 like this before...
1470
1476
1471 * IPython/genutils.py (get_home_dir): add protection against
1477 * IPython/genutils.py (get_home_dir): add protection against
1472 non-dirs in win32 registry.
1478 non-dirs in win32 registry.
1473
1479
1474 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1480 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1475 bug where dict was mutated while iterating (pysh crash).
1481 bug where dict was mutated while iterating (pysh crash).
1476
1482
1477 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1483 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1478
1484
1479 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1485 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1480 spurious newlines added by this routine. After a report by
1486 spurious newlines added by this routine. After a report by
1481 F. Mantegazza.
1487 F. Mantegazza.
1482
1488
1483 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1489 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1484
1490
1485 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1491 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1486 calls. These were a leftover from the GTK 1.x days, and can cause
1492 calls. These were a leftover from the GTK 1.x days, and can cause
1487 problems in certain cases (after a report by John Hunter).
1493 problems in certain cases (after a report by John Hunter).
1488
1494
1489 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1495 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1490 os.getcwd() fails at init time. Thanks to patch from David Remahl
1496 os.getcwd() fails at init time. Thanks to patch from David Remahl
1491 <chmod007-AT-mac.com>.
1497 <chmod007-AT-mac.com>.
1492 (InteractiveShell.__init__): prevent certain special magics from
1498 (InteractiveShell.__init__): prevent certain special magics from
1493 being shadowed by aliases. Closes
1499 being shadowed by aliases. Closes
1494 http://www.scipy.net/roundup/ipython/issue41.
1500 http://www.scipy.net/roundup/ipython/issue41.
1495
1501
1496 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1502 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1497
1503
1498 * IPython/iplib.py (InteractiveShell.complete): Added new
1504 * IPython/iplib.py (InteractiveShell.complete): Added new
1499 top-level completion method to expose the completion mechanism
1505 top-level completion method to expose the completion mechanism
1500 beyond readline-based environments.
1506 beyond readline-based environments.
1501
1507
1502 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1508 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1503
1509
1504 * tools/ipsvnc (svnversion): fix svnversion capture.
1510 * tools/ipsvnc (svnversion): fix svnversion capture.
1505
1511
1506 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1512 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1507 attribute to self, which was missing. Before, it was set by a
1513 attribute to self, which was missing. Before, it was set by a
1508 routine which in certain cases wasn't being called, so the
1514 routine which in certain cases wasn't being called, so the
1509 instance could end up missing the attribute. This caused a crash.
1515 instance could end up missing the attribute. This caused a crash.
1510 Closes http://www.scipy.net/roundup/ipython/issue40.
1516 Closes http://www.scipy.net/roundup/ipython/issue40.
1511
1517
1512 2005-08-16 Fernando Perez <fperez@colorado.edu>
1518 2005-08-16 Fernando Perez <fperez@colorado.edu>
1513
1519
1514 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1520 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1515 contains non-string attribute. Closes
1521 contains non-string attribute. Closes
1516 http://www.scipy.net/roundup/ipython/issue38.
1522 http://www.scipy.net/roundup/ipython/issue38.
1517
1523
1518 2005-08-14 Fernando Perez <fperez@colorado.edu>
1524 2005-08-14 Fernando Perez <fperez@colorado.edu>
1519
1525
1520 * tools/ipsvnc: Minor improvements, to add changeset info.
1526 * tools/ipsvnc: Minor improvements, to add changeset info.
1521
1527
1522 2005-08-12 Fernando Perez <fperez@colorado.edu>
1528 2005-08-12 Fernando Perez <fperez@colorado.edu>
1523
1529
1524 * IPython/iplib.py (runsource): remove self.code_to_run_src
1530 * IPython/iplib.py (runsource): remove self.code_to_run_src
1525 attribute. I realized this is nothing more than
1531 attribute. I realized this is nothing more than
1526 '\n'.join(self.buffer), and having the same data in two different
1532 '\n'.join(self.buffer), and having the same data in two different
1527 places is just asking for synchronization bugs. This may impact
1533 places is just asking for synchronization bugs. This may impact
1528 people who have custom exception handlers, so I need to warn
1534 people who have custom exception handlers, so I need to warn
1529 ipython-dev about it (F. Mantegazza may use them).
1535 ipython-dev about it (F. Mantegazza may use them).
1530
1536
1531 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1537 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1532
1538
1533 * IPython/genutils.py: fix 2.2 compatibility (generators)
1539 * IPython/genutils.py: fix 2.2 compatibility (generators)
1534
1540
1535 2005-07-18 Fernando Perez <fperez@colorado.edu>
1541 2005-07-18 Fernando Perez <fperez@colorado.edu>
1536
1542
1537 * IPython/genutils.py (get_home_dir): fix to help users with
1543 * IPython/genutils.py (get_home_dir): fix to help users with
1538 invalid $HOME under win32.
1544 invalid $HOME under win32.
1539
1545
1540 2005-07-17 Fernando Perez <fperez@colorado.edu>
1546 2005-07-17 Fernando Perez <fperez@colorado.edu>
1541
1547
1542 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1548 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1543 some old hacks and clean up a bit other routines; code should be
1549 some old hacks and clean up a bit other routines; code should be
1544 simpler and a bit faster.
1550 simpler and a bit faster.
1545
1551
1546 * IPython/iplib.py (interact): removed some last-resort attempts
1552 * IPython/iplib.py (interact): removed some last-resort attempts
1547 to survive broken stdout/stderr. That code was only making it
1553 to survive broken stdout/stderr. That code was only making it
1548 harder to abstract out the i/o (necessary for gui integration),
1554 harder to abstract out the i/o (necessary for gui integration),
1549 and the crashes it could prevent were extremely rare in practice
1555 and the crashes it could prevent were extremely rare in practice
1550 (besides being fully user-induced in a pretty violent manner).
1556 (besides being fully user-induced in a pretty violent manner).
1551
1557
1552 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1558 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1553 Nothing major yet, but the code is simpler to read; this should
1559 Nothing major yet, but the code is simpler to read; this should
1554 make it easier to do more serious modifications in the future.
1560 make it easier to do more serious modifications in the future.
1555
1561
1556 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1562 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1557 which broke in .15 (thanks to a report by Ville).
1563 which broke in .15 (thanks to a report by Ville).
1558
1564
1559 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1565 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1560 be quite correct, I know next to nothing about unicode). This
1566 be quite correct, I know next to nothing about unicode). This
1561 will allow unicode strings to be used in prompts, amongst other
1567 will allow unicode strings to be used in prompts, amongst other
1562 cases. It also will prevent ipython from crashing when unicode
1568 cases. It also will prevent ipython from crashing when unicode
1563 shows up unexpectedly in many places. If ascii encoding fails, we
1569 shows up unexpectedly in many places. If ascii encoding fails, we
1564 assume utf_8. Currently the encoding is not a user-visible
1570 assume utf_8. Currently the encoding is not a user-visible
1565 setting, though it could be made so if there is demand for it.
1571 setting, though it could be made so if there is demand for it.
1566
1572
1567 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1573 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1568
1574
1569 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1575 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1570
1576
1571 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1577 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1572
1578
1573 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1579 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1574 code can work transparently for 2.2/2.3.
1580 code can work transparently for 2.2/2.3.
1575
1581
1576 2005-07-16 Fernando Perez <fperez@colorado.edu>
1582 2005-07-16 Fernando Perez <fperez@colorado.edu>
1577
1583
1578 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1584 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1579 out of the color scheme table used for coloring exception
1585 out of the color scheme table used for coloring exception
1580 tracebacks. This allows user code to add new schemes at runtime.
1586 tracebacks. This allows user code to add new schemes at runtime.
1581 This is a minimally modified version of the patch at
1587 This is a minimally modified version of the patch at
1582 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1588 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1583 for the contribution.
1589 for the contribution.
1584
1590
1585 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1591 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1586 slightly modified version of the patch in
1592 slightly modified version of the patch in
1587 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1593 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1588 to remove the previous try/except solution (which was costlier).
1594 to remove the previous try/except solution (which was costlier).
1589 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1595 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1590
1596
1591 2005-06-08 Fernando Perez <fperez@colorado.edu>
1597 2005-06-08 Fernando Perez <fperez@colorado.edu>
1592
1598
1593 * IPython/iplib.py (write/write_err): Add methods to abstract all
1599 * IPython/iplib.py (write/write_err): Add methods to abstract all
1594 I/O a bit more.
1600 I/O a bit more.
1595
1601
1596 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1602 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1597 warning, reported by Aric Hagberg, fix by JD Hunter.
1603 warning, reported by Aric Hagberg, fix by JD Hunter.
1598
1604
1599 2005-06-02 *** Released version 0.6.15
1605 2005-06-02 *** Released version 0.6.15
1600
1606
1601 2005-06-01 Fernando Perez <fperez@colorado.edu>
1607 2005-06-01 Fernando Perez <fperez@colorado.edu>
1602
1608
1603 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1609 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1604 tab-completion of filenames within open-quoted strings. Note that
1610 tab-completion of filenames within open-quoted strings. Note that
1605 this requires that in ~/.ipython/ipythonrc, users change the
1611 this requires that in ~/.ipython/ipythonrc, users change the
1606 readline delimiters configuration to read:
1612 readline delimiters configuration to read:
1607
1613
1608 readline_remove_delims -/~
1614 readline_remove_delims -/~
1609
1615
1610
1616
1611 2005-05-31 *** Released version 0.6.14
1617 2005-05-31 *** Released version 0.6.14
1612
1618
1613 2005-05-29 Fernando Perez <fperez@colorado.edu>
1619 2005-05-29 Fernando Perez <fperez@colorado.edu>
1614
1620
1615 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1621 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1616 with files not on the filesystem. Reported by Eliyahu Sandler
1622 with files not on the filesystem. Reported by Eliyahu Sandler
1617 <eli@gondolin.net>
1623 <eli@gondolin.net>
1618
1624
1619 2005-05-22 Fernando Perez <fperez@colorado.edu>
1625 2005-05-22 Fernando Perez <fperez@colorado.edu>
1620
1626
1621 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1627 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1622 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1628 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1623
1629
1624 2005-05-19 Fernando Perez <fperez@colorado.edu>
1630 2005-05-19 Fernando Perez <fperez@colorado.edu>
1625
1631
1626 * IPython/iplib.py (safe_execfile): close a file which could be
1632 * IPython/iplib.py (safe_execfile): close a file which could be
1627 left open (causing problems in win32, which locks open files).
1633 left open (causing problems in win32, which locks open files).
1628 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1634 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1629
1635
1630 2005-05-18 Fernando Perez <fperez@colorado.edu>
1636 2005-05-18 Fernando Perez <fperez@colorado.edu>
1631
1637
1632 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1638 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1633 keyword arguments correctly to safe_execfile().
1639 keyword arguments correctly to safe_execfile().
1634
1640
1635 2005-05-13 Fernando Perez <fperez@colorado.edu>
1641 2005-05-13 Fernando Perez <fperez@colorado.edu>
1636
1642
1637 * ipython.1: Added info about Qt to manpage, and threads warning
1643 * ipython.1: Added info about Qt to manpage, and threads warning
1638 to usage page (invoked with --help).
1644 to usage page (invoked with --help).
1639
1645
1640 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1646 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1641 new matcher (it goes at the end of the priority list) to do
1647 new matcher (it goes at the end of the priority list) to do
1642 tab-completion on named function arguments. Submitted by George
1648 tab-completion on named function arguments. Submitted by George
1643 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1649 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1644 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1650 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1645 for more details.
1651 for more details.
1646
1652
1647 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1653 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1648 SystemExit exceptions in the script being run. Thanks to a report
1654 SystemExit exceptions in the script being run. Thanks to a report
1649 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1655 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1650 producing very annoying behavior when running unit tests.
1656 producing very annoying behavior when running unit tests.
1651
1657
1652 2005-05-12 Fernando Perez <fperez@colorado.edu>
1658 2005-05-12 Fernando Perez <fperez@colorado.edu>
1653
1659
1654 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1660 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1655 which I'd broken (again) due to a changed regexp. In the process,
1661 which I'd broken (again) due to a changed regexp. In the process,
1656 added ';' as an escape to auto-quote the whole line without
1662 added ';' as an escape to auto-quote the whole line without
1657 splitting its arguments. Thanks to a report by Jerry McRae
1663 splitting its arguments. Thanks to a report by Jerry McRae
1658 <qrs0xyc02-AT-sneakemail.com>.
1664 <qrs0xyc02-AT-sneakemail.com>.
1659
1665
1660 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1666 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1661 possible crashes caused by a TokenError. Reported by Ed Schofield
1667 possible crashes caused by a TokenError. Reported by Ed Schofield
1662 <schofield-AT-ftw.at>.
1668 <schofield-AT-ftw.at>.
1663
1669
1664 2005-05-06 Fernando Perez <fperez@colorado.edu>
1670 2005-05-06 Fernando Perez <fperez@colorado.edu>
1665
1671
1666 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1672 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1667
1673
1668 2005-04-29 Fernando Perez <fperez@colorado.edu>
1674 2005-04-29 Fernando Perez <fperez@colorado.edu>
1669
1675
1670 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1676 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1671 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1677 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1672 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1678 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1673 which provides support for Qt interactive usage (similar to the
1679 which provides support for Qt interactive usage (similar to the
1674 existing one for WX and GTK). This had been often requested.
1680 existing one for WX and GTK). This had been often requested.
1675
1681
1676 2005-04-14 *** Released version 0.6.13
1682 2005-04-14 *** Released version 0.6.13
1677
1683
1678 2005-04-08 Fernando Perez <fperez@colorado.edu>
1684 2005-04-08 Fernando Perez <fperez@colorado.edu>
1679
1685
1680 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1686 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1681 from _ofind, which gets called on almost every input line. Now,
1687 from _ofind, which gets called on almost every input line. Now,
1682 we only try to get docstrings if they are actually going to be
1688 we only try to get docstrings if they are actually going to be
1683 used (the overhead of fetching unnecessary docstrings can be
1689 used (the overhead of fetching unnecessary docstrings can be
1684 noticeable for certain objects, such as Pyro proxies).
1690 noticeable for certain objects, such as Pyro proxies).
1685
1691
1686 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1692 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1687 for completers. For some reason I had been passing them the state
1693 for completers. For some reason I had been passing them the state
1688 variable, which completers never actually need, and was in
1694 variable, which completers never actually need, and was in
1689 conflict with the rlcompleter API. Custom completers ONLY need to
1695 conflict with the rlcompleter API. Custom completers ONLY need to
1690 take the text parameter.
1696 take the text parameter.
1691
1697
1692 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1698 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1693 work correctly in pysh. I've also moved all the logic which used
1699 work correctly in pysh. I've also moved all the logic which used
1694 to be in pysh.py here, which will prevent problems with future
1700 to be in pysh.py here, which will prevent problems with future
1695 upgrades. However, this time I must warn users to update their
1701 upgrades. However, this time I must warn users to update their
1696 pysh profile to include the line
1702 pysh profile to include the line
1697
1703
1698 import_all IPython.Extensions.InterpreterExec
1704 import_all IPython.Extensions.InterpreterExec
1699
1705
1700 because otherwise things won't work for them. They MUST also
1706 because otherwise things won't work for them. They MUST also
1701 delete pysh.py and the line
1707 delete pysh.py and the line
1702
1708
1703 execfile pysh.py
1709 execfile pysh.py
1704
1710
1705 from their ipythonrc-pysh.
1711 from their ipythonrc-pysh.
1706
1712
1707 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1713 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1708 robust in the face of objects whose dir() returns non-strings
1714 robust in the face of objects whose dir() returns non-strings
1709 (which it shouldn't, but some broken libs like ITK do). Thanks to
1715 (which it shouldn't, but some broken libs like ITK do). Thanks to
1710 a patch by John Hunter (implemented differently, though). Also
1716 a patch by John Hunter (implemented differently, though). Also
1711 minor improvements by using .extend instead of + on lists.
1717 minor improvements by using .extend instead of + on lists.
1712
1718
1713 * pysh.py:
1719 * pysh.py:
1714
1720
1715 2005-04-06 Fernando Perez <fperez@colorado.edu>
1721 2005-04-06 Fernando Perez <fperez@colorado.edu>
1716
1722
1717 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1723 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1718 by default, so that all users benefit from it. Those who don't
1724 by default, so that all users benefit from it. Those who don't
1719 want it can still turn it off.
1725 want it can still turn it off.
1720
1726
1721 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1727 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1722 config file, I'd forgotten about this, so users were getting it
1728 config file, I'd forgotten about this, so users were getting it
1723 off by default.
1729 off by default.
1724
1730
1725 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1731 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1726 consistency. Now magics can be called in multiline statements,
1732 consistency. Now magics can be called in multiline statements,
1727 and python variables can be expanded in magic calls via $var.
1733 and python variables can be expanded in magic calls via $var.
1728 This makes the magic system behave just like aliases or !system
1734 This makes the magic system behave just like aliases or !system
1729 calls.
1735 calls.
1730
1736
1731 2005-03-28 Fernando Perez <fperez@colorado.edu>
1737 2005-03-28 Fernando Perez <fperez@colorado.edu>
1732
1738
1733 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1739 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1734 expensive string additions for building command. Add support for
1740 expensive string additions for building command. Add support for
1735 trailing ';' when autocall is used.
1741 trailing ';' when autocall is used.
1736
1742
1737 2005-03-26 Fernando Perez <fperez@colorado.edu>
1743 2005-03-26 Fernando Perez <fperez@colorado.edu>
1738
1744
1739 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1745 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1740 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1746 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1741 ipython.el robust against prompts with any number of spaces
1747 ipython.el robust against prompts with any number of spaces
1742 (including 0) after the ':' character.
1748 (including 0) after the ':' character.
1743
1749
1744 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1750 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1745 continuation prompt, which misled users to think the line was
1751 continuation prompt, which misled users to think the line was
1746 already indented. Closes debian Bug#300847, reported to me by
1752 already indented. Closes debian Bug#300847, reported to me by
1747 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1753 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1748
1754
1749 2005-03-23 Fernando Perez <fperez@colorado.edu>
1755 2005-03-23 Fernando Perez <fperez@colorado.edu>
1750
1756
1751 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1757 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1752 properly aligned if they have embedded newlines.
1758 properly aligned if they have embedded newlines.
1753
1759
1754 * IPython/iplib.py (runlines): Add a public method to expose
1760 * IPython/iplib.py (runlines): Add a public method to expose
1755 IPython's code execution machinery, so that users can run strings
1761 IPython's code execution machinery, so that users can run strings
1756 as if they had been typed at the prompt interactively.
1762 as if they had been typed at the prompt interactively.
1757 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1763 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1758 methods which can call the system shell, but with python variable
1764 methods which can call the system shell, but with python variable
1759 expansion. The three such methods are: __IPYTHON__.system,
1765 expansion. The three such methods are: __IPYTHON__.system,
1760 .getoutput and .getoutputerror. These need to be documented in a
1766 .getoutput and .getoutputerror. These need to be documented in a
1761 'public API' section (to be written) of the manual.
1767 'public API' section (to be written) of the manual.
1762
1768
1763 2005-03-20 Fernando Perez <fperez@colorado.edu>
1769 2005-03-20 Fernando Perez <fperez@colorado.edu>
1764
1770
1765 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1771 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1766 for custom exception handling. This is quite powerful, and it
1772 for custom exception handling. This is quite powerful, and it
1767 allows for user-installable exception handlers which can trap
1773 allows for user-installable exception handlers which can trap
1768 custom exceptions at runtime and treat them separately from
1774 custom exceptions at runtime and treat them separately from
1769 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1775 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1770 Mantegazza <mantegazza-AT-ill.fr>.
1776 Mantegazza <mantegazza-AT-ill.fr>.
1771 (InteractiveShell.set_custom_completer): public API function to
1777 (InteractiveShell.set_custom_completer): public API function to
1772 add new completers at runtime.
1778 add new completers at runtime.
1773
1779
1774 2005-03-19 Fernando Perez <fperez@colorado.edu>
1780 2005-03-19 Fernando Perez <fperez@colorado.edu>
1775
1781
1776 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1782 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1777 allow objects which provide their docstrings via non-standard
1783 allow objects which provide their docstrings via non-standard
1778 mechanisms (like Pyro proxies) to still be inspected by ipython's
1784 mechanisms (like Pyro proxies) to still be inspected by ipython's
1779 ? system.
1785 ? system.
1780
1786
1781 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1787 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1782 automatic capture system. I tried quite hard to make it work
1788 automatic capture system. I tried quite hard to make it work
1783 reliably, and simply failed. I tried many combinations with the
1789 reliably, and simply failed. I tried many combinations with the
1784 subprocess module, but eventually nothing worked in all needed
1790 subprocess module, but eventually nothing worked in all needed
1785 cases (not blocking stdin for the child, duplicating stdout
1791 cases (not blocking stdin for the child, duplicating stdout
1786 without blocking, etc). The new %sc/%sx still do capture to these
1792 without blocking, etc). The new %sc/%sx still do capture to these
1787 magical list/string objects which make shell use much more
1793 magical list/string objects which make shell use much more
1788 conveninent, so not all is lost.
1794 conveninent, so not all is lost.
1789
1795
1790 XXX - FIX MANUAL for the change above!
1796 XXX - FIX MANUAL for the change above!
1791
1797
1792 (runsource): I copied code.py's runsource() into ipython to modify
1798 (runsource): I copied code.py's runsource() into ipython to modify
1793 it a bit. Now the code object and source to be executed are
1799 it a bit. Now the code object and source to be executed are
1794 stored in ipython. This makes this info accessible to third-party
1800 stored in ipython. This makes this info accessible to third-party
1795 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1801 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1796 Mantegazza <mantegazza-AT-ill.fr>.
1802 Mantegazza <mantegazza-AT-ill.fr>.
1797
1803
1798 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1804 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1799 history-search via readline (like C-p/C-n). I'd wanted this for a
1805 history-search via readline (like C-p/C-n). I'd wanted this for a
1800 long time, but only recently found out how to do it. For users
1806 long time, but only recently found out how to do it. For users
1801 who already have their ipythonrc files made and want this, just
1807 who already have their ipythonrc files made and want this, just
1802 add:
1808 add:
1803
1809
1804 readline_parse_and_bind "\e[A": history-search-backward
1810 readline_parse_and_bind "\e[A": history-search-backward
1805 readline_parse_and_bind "\e[B": history-search-forward
1811 readline_parse_and_bind "\e[B": history-search-forward
1806
1812
1807 2005-03-18 Fernando Perez <fperez@colorado.edu>
1813 2005-03-18 Fernando Perez <fperez@colorado.edu>
1808
1814
1809 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1815 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1810 LSString and SList classes which allow transparent conversions
1816 LSString and SList classes which allow transparent conversions
1811 between list mode and whitespace-separated string.
1817 between list mode and whitespace-separated string.
1812 (magic_r): Fix recursion problem in %r.
1818 (magic_r): Fix recursion problem in %r.
1813
1819
1814 * IPython/genutils.py (LSString): New class to be used for
1820 * IPython/genutils.py (LSString): New class to be used for
1815 automatic storage of the results of all alias/system calls in _o
1821 automatic storage of the results of all alias/system calls in _o
1816 and _e (stdout/err). These provide a .l/.list attribute which
1822 and _e (stdout/err). These provide a .l/.list attribute which
1817 does automatic splitting on newlines. This means that for most
1823 does automatic splitting on newlines. This means that for most
1818 uses, you'll never need to do capturing of output with %sc/%sx
1824 uses, you'll never need to do capturing of output with %sc/%sx
1819 anymore, since ipython keeps this always done for you. Note that
1825 anymore, since ipython keeps this always done for you. Note that
1820 only the LAST results are stored, the _o/e variables are
1826 only the LAST results are stored, the _o/e variables are
1821 overwritten on each call. If you need to save their contents
1827 overwritten on each call. If you need to save their contents
1822 further, simply bind them to any other name.
1828 further, simply bind them to any other name.
1823
1829
1824 2005-03-17 Fernando Perez <fperez@colorado.edu>
1830 2005-03-17 Fernando Perez <fperez@colorado.edu>
1825
1831
1826 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1832 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1827 prompt namespace handling.
1833 prompt namespace handling.
1828
1834
1829 2005-03-16 Fernando Perez <fperez@colorado.edu>
1835 2005-03-16 Fernando Perez <fperez@colorado.edu>
1830
1836
1831 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1837 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1832 classic prompts to be '>>> ' (final space was missing, and it
1838 classic prompts to be '>>> ' (final space was missing, and it
1833 trips the emacs python mode).
1839 trips the emacs python mode).
1834 (BasePrompt.__str__): Added safe support for dynamic prompt
1840 (BasePrompt.__str__): Added safe support for dynamic prompt
1835 strings. Now you can set your prompt string to be '$x', and the
1841 strings. Now you can set your prompt string to be '$x', and the
1836 value of x will be printed from your interactive namespace. The
1842 value of x will be printed from your interactive namespace. The
1837 interpolation syntax includes the full Itpl support, so
1843 interpolation syntax includes the full Itpl support, so
1838 ${foo()+x+bar()} is a valid prompt string now, and the function
1844 ${foo()+x+bar()} is a valid prompt string now, and the function
1839 calls will be made at runtime.
1845 calls will be made at runtime.
1840
1846
1841 2005-03-15 Fernando Perez <fperez@colorado.edu>
1847 2005-03-15 Fernando Perez <fperez@colorado.edu>
1842
1848
1843 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1849 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1844 avoid name clashes in pylab. %hist still works, it just forwards
1850 avoid name clashes in pylab. %hist still works, it just forwards
1845 the call to %history.
1851 the call to %history.
1846
1852
1847 2005-03-02 *** Released version 0.6.12
1853 2005-03-02 *** Released version 0.6.12
1848
1854
1849 2005-03-02 Fernando Perez <fperez@colorado.edu>
1855 2005-03-02 Fernando Perez <fperez@colorado.edu>
1850
1856
1851 * IPython/iplib.py (handle_magic): log magic calls properly as
1857 * IPython/iplib.py (handle_magic): log magic calls properly as
1852 ipmagic() function calls.
1858 ipmagic() function calls.
1853
1859
1854 * IPython/Magic.py (magic_time): Improved %time to support
1860 * IPython/Magic.py (magic_time): Improved %time to support
1855 statements and provide wall-clock as well as CPU time.
1861 statements and provide wall-clock as well as CPU time.
1856
1862
1857 2005-02-27 Fernando Perez <fperez@colorado.edu>
1863 2005-02-27 Fernando Perez <fperez@colorado.edu>
1858
1864
1859 * IPython/hooks.py: New hooks module, to expose user-modifiable
1865 * IPython/hooks.py: New hooks module, to expose user-modifiable
1860 IPython functionality in a clean manner. For now only the editor
1866 IPython functionality in a clean manner. For now only the editor
1861 hook is actually written, and other thigns which I intend to turn
1867 hook is actually written, and other thigns which I intend to turn
1862 into proper hooks aren't yet there. The display and prefilter
1868 into proper hooks aren't yet there. The display and prefilter
1863 stuff, for example, should be hooks. But at least now the
1869 stuff, for example, should be hooks. But at least now the
1864 framework is in place, and the rest can be moved here with more
1870 framework is in place, and the rest can be moved here with more
1865 time later. IPython had had a .hooks variable for a long time for
1871 time later. IPython had had a .hooks variable for a long time for
1866 this purpose, but I'd never actually used it for anything.
1872 this purpose, but I'd never actually used it for anything.
1867
1873
1868 2005-02-26 Fernando Perez <fperez@colorado.edu>
1874 2005-02-26 Fernando Perez <fperez@colorado.edu>
1869
1875
1870 * IPython/ipmaker.py (make_IPython): make the default ipython
1876 * IPython/ipmaker.py (make_IPython): make the default ipython
1871 directory be called _ipython under win32, to follow more the
1877 directory be called _ipython under win32, to follow more the
1872 naming peculiarities of that platform (where buggy software like
1878 naming peculiarities of that platform (where buggy software like
1873 Visual Sourcesafe breaks with .named directories). Reported by
1879 Visual Sourcesafe breaks with .named directories). Reported by
1874 Ville Vainio.
1880 Ville Vainio.
1875
1881
1876 2005-02-23 Fernando Perez <fperez@colorado.edu>
1882 2005-02-23 Fernando Perez <fperez@colorado.edu>
1877
1883
1878 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1884 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1879 auto_aliases for win32 which were causing problems. Users can
1885 auto_aliases for win32 which were causing problems. Users can
1880 define the ones they personally like.
1886 define the ones they personally like.
1881
1887
1882 2005-02-21 Fernando Perez <fperez@colorado.edu>
1888 2005-02-21 Fernando Perez <fperez@colorado.edu>
1883
1889
1884 * IPython/Magic.py (magic_time): new magic to time execution of
1890 * IPython/Magic.py (magic_time): new magic to time execution of
1885 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1891 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1886
1892
1887 2005-02-19 Fernando Perez <fperez@colorado.edu>
1893 2005-02-19 Fernando Perez <fperez@colorado.edu>
1888
1894
1889 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1895 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1890 into keys (for prompts, for example).
1896 into keys (for prompts, for example).
1891
1897
1892 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1898 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1893 prompts in case users want them. This introduces a small behavior
1899 prompts in case users want them. This introduces a small behavior
1894 change: ipython does not automatically add a space to all prompts
1900 change: ipython does not automatically add a space to all prompts
1895 anymore. To get the old prompts with a space, users should add it
1901 anymore. To get the old prompts with a space, users should add it
1896 manually to their ipythonrc file, so for example prompt_in1 should
1902 manually to their ipythonrc file, so for example prompt_in1 should
1897 now read 'In [\#]: ' instead of 'In [\#]:'.
1903 now read 'In [\#]: ' instead of 'In [\#]:'.
1898 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1904 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1899 file) to control left-padding of secondary prompts.
1905 file) to control left-padding of secondary prompts.
1900
1906
1901 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1907 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1902 the profiler can't be imported. Fix for Debian, which removed
1908 the profiler can't be imported. Fix for Debian, which removed
1903 profile.py because of License issues. I applied a slightly
1909 profile.py because of License issues. I applied a slightly
1904 modified version of the original Debian patch at
1910 modified version of the original Debian patch at
1905 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1911 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1906
1912
1907 2005-02-17 Fernando Perez <fperez@colorado.edu>
1913 2005-02-17 Fernando Perez <fperez@colorado.edu>
1908
1914
1909 * IPython/genutils.py (native_line_ends): Fix bug which would
1915 * IPython/genutils.py (native_line_ends): Fix bug which would
1910 cause improper line-ends under win32 b/c I was not opening files
1916 cause improper line-ends under win32 b/c I was not opening files
1911 in binary mode. Bug report and fix thanks to Ville.
1917 in binary mode. Bug report and fix thanks to Ville.
1912
1918
1913 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1919 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1914 trying to catch spurious foo[1] autocalls. My fix actually broke
1920 trying to catch spurious foo[1] autocalls. My fix actually broke
1915 ',/' autoquote/call with explicit escape (bad regexp).
1921 ',/' autoquote/call with explicit escape (bad regexp).
1916
1922
1917 2005-02-15 *** Released version 0.6.11
1923 2005-02-15 *** Released version 0.6.11
1918
1924
1919 2005-02-14 Fernando Perez <fperez@colorado.edu>
1925 2005-02-14 Fernando Perez <fperez@colorado.edu>
1920
1926
1921 * IPython/background_jobs.py: New background job management
1927 * IPython/background_jobs.py: New background job management
1922 subsystem. This is implemented via a new set of classes, and
1928 subsystem. This is implemented via a new set of classes, and
1923 IPython now provides a builtin 'jobs' object for background job
1929 IPython now provides a builtin 'jobs' object for background job
1924 execution. A convenience %bg magic serves as a lightweight
1930 execution. A convenience %bg magic serves as a lightweight
1925 frontend for starting the more common type of calls. This was
1931 frontend for starting the more common type of calls. This was
1926 inspired by discussions with B. Granger and the BackgroundCommand
1932 inspired by discussions with B. Granger and the BackgroundCommand
1927 class described in the book Python Scripting for Computational
1933 class described in the book Python Scripting for Computational
1928 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1934 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1929 (although ultimately no code from this text was used, as IPython's
1935 (although ultimately no code from this text was used, as IPython's
1930 system is a separate implementation).
1936 system is a separate implementation).
1931
1937
1932 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1938 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1933 to control the completion of single/double underscore names
1939 to control the completion of single/double underscore names
1934 separately. As documented in the example ipytonrc file, the
1940 separately. As documented in the example ipytonrc file, the
1935 readline_omit__names variable can now be set to 2, to omit even
1941 readline_omit__names variable can now be set to 2, to omit even
1936 single underscore names. Thanks to a patch by Brian Wong
1942 single underscore names. Thanks to a patch by Brian Wong
1937 <BrianWong-AT-AirgoNetworks.Com>.
1943 <BrianWong-AT-AirgoNetworks.Com>.
1938 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1944 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1939 be autocalled as foo([1]) if foo were callable. A problem for
1945 be autocalled as foo([1]) if foo were callable. A problem for
1940 things which are both callable and implement __getitem__.
1946 things which are both callable and implement __getitem__.
1941 (init_readline): Fix autoindentation for win32. Thanks to a patch
1947 (init_readline): Fix autoindentation for win32. Thanks to a patch
1942 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1948 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1943
1949
1944 2005-02-12 Fernando Perez <fperez@colorado.edu>
1950 2005-02-12 Fernando Perez <fperez@colorado.edu>
1945
1951
1946 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1952 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1947 which I had written long ago to sort out user error messages which
1953 which I had written long ago to sort out user error messages which
1948 may occur during startup. This seemed like a good idea initially,
1954 may occur during startup. This seemed like a good idea initially,
1949 but it has proven a disaster in retrospect. I don't want to
1955 but it has proven a disaster in retrospect. I don't want to
1950 change much code for now, so my fix is to set the internal 'debug'
1956 change much code for now, so my fix is to set the internal 'debug'
1951 flag to true everywhere, whose only job was precisely to control
1957 flag to true everywhere, whose only job was precisely to control
1952 this subsystem. This closes issue 28 (as well as avoiding all
1958 this subsystem. This closes issue 28 (as well as avoiding all
1953 sorts of strange hangups which occur from time to time).
1959 sorts of strange hangups which occur from time to time).
1954
1960
1955 2005-02-07 Fernando Perez <fperez@colorado.edu>
1961 2005-02-07 Fernando Perez <fperez@colorado.edu>
1956
1962
1957 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1963 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1958 previous call produced a syntax error.
1964 previous call produced a syntax error.
1959
1965
1960 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1966 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1961 classes without constructor.
1967 classes without constructor.
1962
1968
1963 2005-02-06 Fernando Perez <fperez@colorado.edu>
1969 2005-02-06 Fernando Perez <fperez@colorado.edu>
1964
1970
1965 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1971 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1966 completions with the results of each matcher, so we return results
1972 completions with the results of each matcher, so we return results
1967 to the user from all namespaces. This breaks with ipython
1973 to the user from all namespaces. This breaks with ipython
1968 tradition, but I think it's a nicer behavior. Now you get all
1974 tradition, but I think it's a nicer behavior. Now you get all
1969 possible completions listed, from all possible namespaces (python,
1975 possible completions listed, from all possible namespaces (python,
1970 filesystem, magics...) After a request by John Hunter
1976 filesystem, magics...) After a request by John Hunter
1971 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1977 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1972
1978
1973 2005-02-05 Fernando Perez <fperez@colorado.edu>
1979 2005-02-05 Fernando Perez <fperez@colorado.edu>
1974
1980
1975 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1981 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1976 the call had quote characters in it (the quotes were stripped).
1982 the call had quote characters in it (the quotes were stripped).
1977
1983
1978 2005-01-31 Fernando Perez <fperez@colorado.edu>
1984 2005-01-31 Fernando Perez <fperez@colorado.edu>
1979
1985
1980 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1986 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1981 Itpl.itpl() to make the code more robust against psyco
1987 Itpl.itpl() to make the code more robust against psyco
1982 optimizations.
1988 optimizations.
1983
1989
1984 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1990 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1985 of causing an exception. Quicker, cleaner.
1991 of causing an exception. Quicker, cleaner.
1986
1992
1987 2005-01-28 Fernando Perez <fperez@colorado.edu>
1993 2005-01-28 Fernando Perez <fperez@colorado.edu>
1988
1994
1989 * scripts/ipython_win_post_install.py (install): hardcode
1995 * scripts/ipython_win_post_install.py (install): hardcode
1990 sys.prefix+'python.exe' as the executable path. It turns out that
1996 sys.prefix+'python.exe' as the executable path. It turns out that
1991 during the post-installation run, sys.executable resolves to the
1997 during the post-installation run, sys.executable resolves to the
1992 name of the binary installer! I should report this as a distutils
1998 name of the binary installer! I should report this as a distutils
1993 bug, I think. I updated the .10 release with this tiny fix, to
1999 bug, I think. I updated the .10 release with this tiny fix, to
1994 avoid annoying the lists further.
2000 avoid annoying the lists further.
1995
2001
1996 2005-01-27 *** Released version 0.6.10
2002 2005-01-27 *** Released version 0.6.10
1997
2003
1998 2005-01-27 Fernando Perez <fperez@colorado.edu>
2004 2005-01-27 Fernando Perez <fperez@colorado.edu>
1999
2005
2000 * IPython/numutils.py (norm): Added 'inf' as optional name for
2006 * IPython/numutils.py (norm): Added 'inf' as optional name for
2001 L-infinity norm, included references to mathworld.com for vector
2007 L-infinity norm, included references to mathworld.com for vector
2002 norm definitions.
2008 norm definitions.
2003 (amin/amax): added amin/amax for array min/max. Similar to what
2009 (amin/amax): added amin/amax for array min/max. Similar to what
2004 pylab ships with after the recent reorganization of names.
2010 pylab ships with after the recent reorganization of names.
2005 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2011 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2006
2012
2007 * ipython.el: committed Alex's recent fixes and improvements.
2013 * ipython.el: committed Alex's recent fixes and improvements.
2008 Tested with python-mode from CVS, and it looks excellent. Since
2014 Tested with python-mode from CVS, and it looks excellent. Since
2009 python-mode hasn't released anything in a while, I'm temporarily
2015 python-mode hasn't released anything in a while, I'm temporarily
2010 putting a copy of today's CVS (v 4.70) of python-mode in:
2016 putting a copy of today's CVS (v 4.70) of python-mode in:
2011 http://ipython.scipy.org/tmp/python-mode.el
2017 http://ipython.scipy.org/tmp/python-mode.el
2012
2018
2013 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2019 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2014 sys.executable for the executable name, instead of assuming it's
2020 sys.executable for the executable name, instead of assuming it's
2015 called 'python.exe' (the post-installer would have produced broken
2021 called 'python.exe' (the post-installer would have produced broken
2016 setups on systems with a differently named python binary).
2022 setups on systems with a differently named python binary).
2017
2023
2018 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2024 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2019 references to os.linesep, to make the code more
2025 references to os.linesep, to make the code more
2020 platform-independent. This is also part of the win32 coloring
2026 platform-independent. This is also part of the win32 coloring
2021 fixes.
2027 fixes.
2022
2028
2023 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2029 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2024 lines, which actually cause coloring bugs because the length of
2030 lines, which actually cause coloring bugs because the length of
2025 the line is very difficult to correctly compute with embedded
2031 the line is very difficult to correctly compute with embedded
2026 escapes. This was the source of all the coloring problems under
2032 escapes. This was the source of all the coloring problems under
2027 Win32. I think that _finally_, Win32 users have a properly
2033 Win32. I think that _finally_, Win32 users have a properly
2028 working ipython in all respects. This would never have happened
2034 working ipython in all respects. This would never have happened
2029 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2035 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2030
2036
2031 2005-01-26 *** Released version 0.6.9
2037 2005-01-26 *** Released version 0.6.9
2032
2038
2033 2005-01-25 Fernando Perez <fperez@colorado.edu>
2039 2005-01-25 Fernando Perez <fperez@colorado.edu>
2034
2040
2035 * setup.py: finally, we have a true Windows installer, thanks to
2041 * setup.py: finally, we have a true Windows installer, thanks to
2036 the excellent work of Viktor Ransmayr
2042 the excellent work of Viktor Ransmayr
2037 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2043 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2038 Windows users. The setup routine is quite a bit cleaner thanks to
2044 Windows users. The setup routine is quite a bit cleaner thanks to
2039 this, and the post-install script uses the proper functions to
2045 this, and the post-install script uses the proper functions to
2040 allow a clean de-installation using the standard Windows Control
2046 allow a clean de-installation using the standard Windows Control
2041 Panel.
2047 Panel.
2042
2048
2043 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2049 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2044 environment variable under all OSes (including win32) if
2050 environment variable under all OSes (including win32) if
2045 available. This will give consistency to win32 users who have set
2051 available. This will give consistency to win32 users who have set
2046 this variable for any reason. If os.environ['HOME'] fails, the
2052 this variable for any reason. If os.environ['HOME'] fails, the
2047 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2053 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2048
2054
2049 2005-01-24 Fernando Perez <fperez@colorado.edu>
2055 2005-01-24 Fernando Perez <fperez@colorado.edu>
2050
2056
2051 * IPython/numutils.py (empty_like): add empty_like(), similar to
2057 * IPython/numutils.py (empty_like): add empty_like(), similar to
2052 zeros_like() but taking advantage of the new empty() Numeric routine.
2058 zeros_like() but taking advantage of the new empty() Numeric routine.
2053
2059
2054 2005-01-23 *** Released version 0.6.8
2060 2005-01-23 *** Released version 0.6.8
2055
2061
2056 2005-01-22 Fernando Perez <fperez@colorado.edu>
2062 2005-01-22 Fernando Perez <fperez@colorado.edu>
2057
2063
2058 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2064 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2059 automatic show() calls. After discussing things with JDH, it
2065 automatic show() calls. After discussing things with JDH, it
2060 turns out there are too many corner cases where this can go wrong.
2066 turns out there are too many corner cases where this can go wrong.
2061 It's best not to try to be 'too smart', and simply have ipython
2067 It's best not to try to be 'too smart', and simply have ipython
2062 reproduce as much as possible the default behavior of a normal
2068 reproduce as much as possible the default behavior of a normal
2063 python shell.
2069 python shell.
2064
2070
2065 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2071 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2066 line-splitting regexp and _prefilter() to avoid calling getattr()
2072 line-splitting regexp and _prefilter() to avoid calling getattr()
2067 on assignments. This closes
2073 on assignments. This closes
2068 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2074 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2069 readline uses getattr(), so a simple <TAB> keypress is still
2075 readline uses getattr(), so a simple <TAB> keypress is still
2070 enough to trigger getattr() calls on an object.
2076 enough to trigger getattr() calls on an object.
2071
2077
2072 2005-01-21 Fernando Perez <fperez@colorado.edu>
2078 2005-01-21 Fernando Perez <fperez@colorado.edu>
2073
2079
2074 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2080 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2075 docstring under pylab so it doesn't mask the original.
2081 docstring under pylab so it doesn't mask the original.
2076
2082
2077 2005-01-21 *** Released version 0.6.7
2083 2005-01-21 *** Released version 0.6.7
2078
2084
2079 2005-01-21 Fernando Perez <fperez@colorado.edu>
2085 2005-01-21 Fernando Perez <fperez@colorado.edu>
2080
2086
2081 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2087 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2082 signal handling for win32 users in multithreaded mode.
2088 signal handling for win32 users in multithreaded mode.
2083
2089
2084 2005-01-17 Fernando Perez <fperez@colorado.edu>
2090 2005-01-17 Fernando Perez <fperez@colorado.edu>
2085
2091
2086 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2092 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2087 instances with no __init__. After a crash report by Norbert Nemec
2093 instances with no __init__. After a crash report by Norbert Nemec
2088 <Norbert-AT-nemec-online.de>.
2094 <Norbert-AT-nemec-online.de>.
2089
2095
2090 2005-01-14 Fernando Perez <fperez@colorado.edu>
2096 2005-01-14 Fernando Perez <fperez@colorado.edu>
2091
2097
2092 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2098 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2093 names for verbose exceptions, when multiple dotted names and the
2099 names for verbose exceptions, when multiple dotted names and the
2094 'parent' object were present on the same line.
2100 'parent' object were present on the same line.
2095
2101
2096 2005-01-11 Fernando Perez <fperez@colorado.edu>
2102 2005-01-11 Fernando Perez <fperez@colorado.edu>
2097
2103
2098 * IPython/genutils.py (flag_calls): new utility to trap and flag
2104 * IPython/genutils.py (flag_calls): new utility to trap and flag
2099 calls in functions. I need it to clean up matplotlib support.
2105 calls in functions. I need it to clean up matplotlib support.
2100 Also removed some deprecated code in genutils.
2106 Also removed some deprecated code in genutils.
2101
2107
2102 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2108 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2103 that matplotlib scripts called with %run, which don't call show()
2109 that matplotlib scripts called with %run, which don't call show()
2104 themselves, still have their plotting windows open.
2110 themselves, still have their plotting windows open.
2105
2111
2106 2005-01-05 Fernando Perez <fperez@colorado.edu>
2112 2005-01-05 Fernando Perez <fperez@colorado.edu>
2107
2113
2108 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2114 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2109 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2115 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2110
2116
2111 2004-12-19 Fernando Perez <fperez@colorado.edu>
2117 2004-12-19 Fernando Perez <fperez@colorado.edu>
2112
2118
2113 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2119 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2114 parent_runcode, which was an eyesore. The same result can be
2120 parent_runcode, which was an eyesore. The same result can be
2115 obtained with Python's regular superclass mechanisms.
2121 obtained with Python's regular superclass mechanisms.
2116
2122
2117 2004-12-17 Fernando Perez <fperez@colorado.edu>
2123 2004-12-17 Fernando Perez <fperez@colorado.edu>
2118
2124
2119 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2125 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2120 reported by Prabhu.
2126 reported by Prabhu.
2121 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2127 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2122 sys.stderr) instead of explicitly calling sys.stderr. This helps
2128 sys.stderr) instead of explicitly calling sys.stderr. This helps
2123 maintain our I/O abstractions clean, for future GUI embeddings.
2129 maintain our I/O abstractions clean, for future GUI embeddings.
2124
2130
2125 * IPython/genutils.py (info): added new utility for sys.stderr
2131 * IPython/genutils.py (info): added new utility for sys.stderr
2126 unified info message handling (thin wrapper around warn()).
2132 unified info message handling (thin wrapper around warn()).
2127
2133
2128 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2134 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2129 composite (dotted) names on verbose exceptions.
2135 composite (dotted) names on verbose exceptions.
2130 (VerboseTB.nullrepr): harden against another kind of errors which
2136 (VerboseTB.nullrepr): harden against another kind of errors which
2131 Python's inspect module can trigger, and which were crashing
2137 Python's inspect module can trigger, and which were crashing
2132 IPython. Thanks to a report by Marco Lombardi
2138 IPython. Thanks to a report by Marco Lombardi
2133 <mlombard-AT-ma010192.hq.eso.org>.
2139 <mlombard-AT-ma010192.hq.eso.org>.
2134
2140
2135 2004-12-13 *** Released version 0.6.6
2141 2004-12-13 *** Released version 0.6.6
2136
2142
2137 2004-12-12 Fernando Perez <fperez@colorado.edu>
2143 2004-12-12 Fernando Perez <fperez@colorado.edu>
2138
2144
2139 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2145 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2140 generated by pygtk upon initialization if it was built without
2146 generated by pygtk upon initialization if it was built without
2141 threads (for matplotlib users). After a crash reported by
2147 threads (for matplotlib users). After a crash reported by
2142 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2148 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2143
2149
2144 * IPython/ipmaker.py (make_IPython): fix small bug in the
2150 * IPython/ipmaker.py (make_IPython): fix small bug in the
2145 import_some parameter for multiple imports.
2151 import_some parameter for multiple imports.
2146
2152
2147 * IPython/iplib.py (ipmagic): simplified the interface of
2153 * IPython/iplib.py (ipmagic): simplified the interface of
2148 ipmagic() to take a single string argument, just as it would be
2154 ipmagic() to take a single string argument, just as it would be
2149 typed at the IPython cmd line.
2155 typed at the IPython cmd line.
2150 (ipalias): Added new ipalias() with an interface identical to
2156 (ipalias): Added new ipalias() with an interface identical to
2151 ipmagic(). This completes exposing a pure python interface to the
2157 ipmagic(). This completes exposing a pure python interface to the
2152 alias and magic system, which can be used in loops or more complex
2158 alias and magic system, which can be used in loops or more complex
2153 code where IPython's automatic line mangling is not active.
2159 code where IPython's automatic line mangling is not active.
2154
2160
2155 * IPython/genutils.py (timing): changed interface of timing to
2161 * IPython/genutils.py (timing): changed interface of timing to
2156 simply run code once, which is the most common case. timings()
2162 simply run code once, which is the most common case. timings()
2157 remains unchanged, for the cases where you want multiple runs.
2163 remains unchanged, for the cases where you want multiple runs.
2158
2164
2159 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2165 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2160 bug where Python2.2 crashes with exec'ing code which does not end
2166 bug where Python2.2 crashes with exec'ing code which does not end
2161 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2167 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2162 before.
2168 before.
2163
2169
2164 2004-12-10 Fernando Perez <fperez@colorado.edu>
2170 2004-12-10 Fernando Perez <fperez@colorado.edu>
2165
2171
2166 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2172 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2167 -t to -T, to accomodate the new -t flag in %run (the %run and
2173 -t to -T, to accomodate the new -t flag in %run (the %run and
2168 %prun options are kind of intermixed, and it's not easy to change
2174 %prun options are kind of intermixed, and it's not easy to change
2169 this with the limitations of python's getopt).
2175 this with the limitations of python's getopt).
2170
2176
2171 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2177 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2172 the execution of scripts. It's not as fine-tuned as timeit.py,
2178 the execution of scripts. It's not as fine-tuned as timeit.py,
2173 but it works from inside ipython (and under 2.2, which lacks
2179 but it works from inside ipython (and under 2.2, which lacks
2174 timeit.py). Optionally a number of runs > 1 can be given for
2180 timeit.py). Optionally a number of runs > 1 can be given for
2175 timing very short-running code.
2181 timing very short-running code.
2176
2182
2177 * IPython/genutils.py (uniq_stable): new routine which returns a
2183 * IPython/genutils.py (uniq_stable): new routine which returns a
2178 list of unique elements in any iterable, but in stable order of
2184 list of unique elements in any iterable, but in stable order of
2179 appearance. I needed this for the ultraTB fixes, and it's a handy
2185 appearance. I needed this for the ultraTB fixes, and it's a handy
2180 utility.
2186 utility.
2181
2187
2182 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2188 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2183 dotted names in Verbose exceptions. This had been broken since
2189 dotted names in Verbose exceptions. This had been broken since
2184 the very start, now x.y will properly be printed in a Verbose
2190 the very start, now x.y will properly be printed in a Verbose
2185 traceback, instead of x being shown and y appearing always as an
2191 traceback, instead of x being shown and y appearing always as an
2186 'undefined global'. Getting this to work was a bit tricky,
2192 'undefined global'. Getting this to work was a bit tricky,
2187 because by default python tokenizers are stateless. Saved by
2193 because by default python tokenizers are stateless. Saved by
2188 python's ability to easily add a bit of state to an arbitrary
2194 python's ability to easily add a bit of state to an arbitrary
2189 function (without needing to build a full-blown callable object).
2195 function (without needing to build a full-blown callable object).
2190
2196
2191 Also big cleanup of this code, which had horrendous runtime
2197 Also big cleanup of this code, which had horrendous runtime
2192 lookups of zillions of attributes for colorization. Moved all
2198 lookups of zillions of attributes for colorization. Moved all
2193 this code into a few templates, which make it cleaner and quicker.
2199 this code into a few templates, which make it cleaner and quicker.
2194
2200
2195 Printout quality was also improved for Verbose exceptions: one
2201 Printout quality was also improved for Verbose exceptions: one
2196 variable per line, and memory addresses are printed (this can be
2202 variable per line, and memory addresses are printed (this can be
2197 quite handy in nasty debugging situations, which is what Verbose
2203 quite handy in nasty debugging situations, which is what Verbose
2198 is for).
2204 is for).
2199
2205
2200 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2206 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2201 the command line as scripts to be loaded by embedded instances.
2207 the command line as scripts to be loaded by embedded instances.
2202 Doing so has the potential for an infinite recursion if there are
2208 Doing so has the potential for an infinite recursion if there are
2203 exceptions thrown in the process. This fixes a strange crash
2209 exceptions thrown in the process. This fixes a strange crash
2204 reported by Philippe MULLER <muller-AT-irit.fr>.
2210 reported by Philippe MULLER <muller-AT-irit.fr>.
2205
2211
2206 2004-12-09 Fernando Perez <fperez@colorado.edu>
2212 2004-12-09 Fernando Perez <fperez@colorado.edu>
2207
2213
2208 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2214 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2209 to reflect new names in matplotlib, which now expose the
2215 to reflect new names in matplotlib, which now expose the
2210 matlab-compatible interface via a pylab module instead of the
2216 matlab-compatible interface via a pylab module instead of the
2211 'matlab' name. The new code is backwards compatible, so users of
2217 'matlab' name. The new code is backwards compatible, so users of
2212 all matplotlib versions are OK. Patch by J. Hunter.
2218 all matplotlib versions are OK. Patch by J. Hunter.
2213
2219
2214 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2220 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2215 of __init__ docstrings for instances (class docstrings are already
2221 of __init__ docstrings for instances (class docstrings are already
2216 automatically printed). Instances with customized docstrings
2222 automatically printed). Instances with customized docstrings
2217 (indep. of the class) are also recognized and all 3 separate
2223 (indep. of the class) are also recognized and all 3 separate
2218 docstrings are printed (instance, class, constructor). After some
2224 docstrings are printed (instance, class, constructor). After some
2219 comments/suggestions by J. Hunter.
2225 comments/suggestions by J. Hunter.
2220
2226
2221 2004-12-05 Fernando Perez <fperez@colorado.edu>
2227 2004-12-05 Fernando Perez <fperez@colorado.edu>
2222
2228
2223 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2229 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2224 warnings when tab-completion fails and triggers an exception.
2230 warnings when tab-completion fails and triggers an exception.
2225
2231
2226 2004-12-03 Fernando Perez <fperez@colorado.edu>
2232 2004-12-03 Fernando Perez <fperez@colorado.edu>
2227
2233
2228 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2234 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2229 be triggered when using 'run -p'. An incorrect option flag was
2235 be triggered when using 'run -p'. An incorrect option flag was
2230 being set ('d' instead of 'D').
2236 being set ('d' instead of 'D').
2231 (manpage): fix missing escaped \- sign.
2237 (manpage): fix missing escaped \- sign.
2232
2238
2233 2004-11-30 *** Released version 0.6.5
2239 2004-11-30 *** Released version 0.6.5
2234
2240
2235 2004-11-30 Fernando Perez <fperez@colorado.edu>
2241 2004-11-30 Fernando Perez <fperez@colorado.edu>
2236
2242
2237 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2243 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2238 setting with -d option.
2244 setting with -d option.
2239
2245
2240 * setup.py (docfiles): Fix problem where the doc glob I was using
2246 * setup.py (docfiles): Fix problem where the doc glob I was using
2241 was COMPLETELY BROKEN. It was giving the right files by pure
2247 was COMPLETELY BROKEN. It was giving the right files by pure
2242 accident, but failed once I tried to include ipython.el. Note:
2248 accident, but failed once I tried to include ipython.el. Note:
2243 glob() does NOT allow you to do exclusion on multiple endings!
2249 glob() does NOT allow you to do exclusion on multiple endings!
2244
2250
2245 2004-11-29 Fernando Perez <fperez@colorado.edu>
2251 2004-11-29 Fernando Perez <fperez@colorado.edu>
2246
2252
2247 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2253 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2248 the manpage as the source. Better formatting & consistency.
2254 the manpage as the source. Better formatting & consistency.
2249
2255
2250 * IPython/Magic.py (magic_run): Added new -d option, to run
2256 * IPython/Magic.py (magic_run): Added new -d option, to run
2251 scripts under the control of the python pdb debugger. Note that
2257 scripts under the control of the python pdb debugger. Note that
2252 this required changing the %prun option -d to -D, to avoid a clash
2258 this required changing the %prun option -d to -D, to avoid a clash
2253 (since %run must pass options to %prun, and getopt is too dumb to
2259 (since %run must pass options to %prun, and getopt is too dumb to
2254 handle options with string values with embedded spaces). Thanks
2260 handle options with string values with embedded spaces). Thanks
2255 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2261 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2256 (magic_who_ls): added type matching to %who and %whos, so that one
2262 (magic_who_ls): added type matching to %who and %whos, so that one
2257 can filter their output to only include variables of certain
2263 can filter their output to only include variables of certain
2258 types. Another suggestion by Matthew.
2264 types. Another suggestion by Matthew.
2259 (magic_whos): Added memory summaries in kb and Mb for arrays.
2265 (magic_whos): Added memory summaries in kb and Mb for arrays.
2260 (magic_who): Improve formatting (break lines every 9 vars).
2266 (magic_who): Improve formatting (break lines every 9 vars).
2261
2267
2262 2004-11-28 Fernando Perez <fperez@colorado.edu>
2268 2004-11-28 Fernando Perez <fperez@colorado.edu>
2263
2269
2264 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2270 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2265 cache when empty lines were present.
2271 cache when empty lines were present.
2266
2272
2267 2004-11-24 Fernando Perez <fperez@colorado.edu>
2273 2004-11-24 Fernando Perez <fperez@colorado.edu>
2268
2274
2269 * IPython/usage.py (__doc__): document the re-activated threading
2275 * IPython/usage.py (__doc__): document the re-activated threading
2270 options for WX and GTK.
2276 options for WX and GTK.
2271
2277
2272 2004-11-23 Fernando Perez <fperez@colorado.edu>
2278 2004-11-23 Fernando Perez <fperez@colorado.edu>
2273
2279
2274 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2280 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2275 the -wthread and -gthread options, along with a new -tk one to try
2281 the -wthread and -gthread options, along with a new -tk one to try
2276 and coordinate Tk threading with wx/gtk. The tk support is very
2282 and coordinate Tk threading with wx/gtk. The tk support is very
2277 platform dependent, since it seems to require Tcl and Tk to be
2283 platform dependent, since it seems to require Tcl and Tk to be
2278 built with threads (Fedora1/2 appears NOT to have it, but in
2284 built with threads (Fedora1/2 appears NOT to have it, but in
2279 Prabhu's Debian boxes it works OK). But even with some Tk
2285 Prabhu's Debian boxes it works OK). But even with some Tk
2280 limitations, this is a great improvement.
2286 limitations, this is a great improvement.
2281
2287
2282 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2288 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2283 info in user prompts. Patch by Prabhu.
2289 info in user prompts. Patch by Prabhu.
2284
2290
2285 2004-11-18 Fernando Perez <fperez@colorado.edu>
2291 2004-11-18 Fernando Perez <fperez@colorado.edu>
2286
2292
2287 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2293 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2288 EOFErrors and bail, to avoid infinite loops if a non-terminating
2294 EOFErrors and bail, to avoid infinite loops if a non-terminating
2289 file is fed into ipython. Patch submitted in issue 19 by user,
2295 file is fed into ipython. Patch submitted in issue 19 by user,
2290 many thanks.
2296 many thanks.
2291
2297
2292 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2298 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2293 autoquote/parens in continuation prompts, which can cause lots of
2299 autoquote/parens in continuation prompts, which can cause lots of
2294 problems. Closes roundup issue 20.
2300 problems. Closes roundup issue 20.
2295
2301
2296 2004-11-17 Fernando Perez <fperez@colorado.edu>
2302 2004-11-17 Fernando Perez <fperez@colorado.edu>
2297
2303
2298 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2304 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2299 reported as debian bug #280505. I'm not sure my local changelog
2305 reported as debian bug #280505. I'm not sure my local changelog
2300 entry has the proper debian format (Jack?).
2306 entry has the proper debian format (Jack?).
2301
2307
2302 2004-11-08 *** Released version 0.6.4
2308 2004-11-08 *** Released version 0.6.4
2303
2309
2304 2004-11-08 Fernando Perez <fperez@colorado.edu>
2310 2004-11-08 Fernando Perez <fperez@colorado.edu>
2305
2311
2306 * IPython/iplib.py (init_readline): Fix exit message for Windows
2312 * IPython/iplib.py (init_readline): Fix exit message for Windows
2307 when readline is active. Thanks to a report by Eric Jones
2313 when readline is active. Thanks to a report by Eric Jones
2308 <eric-AT-enthought.com>.
2314 <eric-AT-enthought.com>.
2309
2315
2310 2004-11-07 Fernando Perez <fperez@colorado.edu>
2316 2004-11-07 Fernando Perez <fperez@colorado.edu>
2311
2317
2312 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2318 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2313 sometimes seen by win2k/cygwin users.
2319 sometimes seen by win2k/cygwin users.
2314
2320
2315 2004-11-06 Fernando Perez <fperez@colorado.edu>
2321 2004-11-06 Fernando Perez <fperez@colorado.edu>
2316
2322
2317 * IPython/iplib.py (interact): Change the handling of %Exit from
2323 * IPython/iplib.py (interact): Change the handling of %Exit from
2318 trying to propagate a SystemExit to an internal ipython flag.
2324 trying to propagate a SystemExit to an internal ipython flag.
2319 This is less elegant than using Python's exception mechanism, but
2325 This is less elegant than using Python's exception mechanism, but
2320 I can't get that to work reliably with threads, so under -pylab
2326 I can't get that to work reliably with threads, so under -pylab
2321 %Exit was hanging IPython. Cross-thread exception handling is
2327 %Exit was hanging IPython. Cross-thread exception handling is
2322 really a bitch. Thaks to a bug report by Stephen Walton
2328 really a bitch. Thaks to a bug report by Stephen Walton
2323 <stephen.walton-AT-csun.edu>.
2329 <stephen.walton-AT-csun.edu>.
2324
2330
2325 2004-11-04 Fernando Perez <fperez@colorado.edu>
2331 2004-11-04 Fernando Perez <fperez@colorado.edu>
2326
2332
2327 * IPython/iplib.py (raw_input_original): store a pointer to the
2333 * IPython/iplib.py (raw_input_original): store a pointer to the
2328 true raw_input to harden against code which can modify it
2334 true raw_input to harden against code which can modify it
2329 (wx.py.PyShell does this and would otherwise crash ipython).
2335 (wx.py.PyShell does this and would otherwise crash ipython).
2330 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2336 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2331
2337
2332 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2338 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2333 Ctrl-C problem, which does not mess up the input line.
2339 Ctrl-C problem, which does not mess up the input line.
2334
2340
2335 2004-11-03 Fernando Perez <fperez@colorado.edu>
2341 2004-11-03 Fernando Perez <fperez@colorado.edu>
2336
2342
2337 * IPython/Release.py: Changed licensing to BSD, in all files.
2343 * IPython/Release.py: Changed licensing to BSD, in all files.
2338 (name): lowercase name for tarball/RPM release.
2344 (name): lowercase name for tarball/RPM release.
2339
2345
2340 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2346 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2341 use throughout ipython.
2347 use throughout ipython.
2342
2348
2343 * IPython/Magic.py (Magic._ofind): Switch to using the new
2349 * IPython/Magic.py (Magic._ofind): Switch to using the new
2344 OInspect.getdoc() function.
2350 OInspect.getdoc() function.
2345
2351
2346 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2352 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2347 of the line currently being canceled via Ctrl-C. It's extremely
2353 of the line currently being canceled via Ctrl-C. It's extremely
2348 ugly, but I don't know how to do it better (the problem is one of
2354 ugly, but I don't know how to do it better (the problem is one of
2349 handling cross-thread exceptions).
2355 handling cross-thread exceptions).
2350
2356
2351 2004-10-28 Fernando Perez <fperez@colorado.edu>
2357 2004-10-28 Fernando Perez <fperez@colorado.edu>
2352
2358
2353 * IPython/Shell.py (signal_handler): add signal handlers to trap
2359 * IPython/Shell.py (signal_handler): add signal handlers to trap
2354 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2360 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2355 report by Francesc Alted.
2361 report by Francesc Alted.
2356
2362
2357 2004-10-21 Fernando Perez <fperez@colorado.edu>
2363 2004-10-21 Fernando Perez <fperez@colorado.edu>
2358
2364
2359 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2365 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2360 to % for pysh syntax extensions.
2366 to % for pysh syntax extensions.
2361
2367
2362 2004-10-09 Fernando Perez <fperez@colorado.edu>
2368 2004-10-09 Fernando Perez <fperez@colorado.edu>
2363
2369
2364 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2370 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2365 arrays to print a more useful summary, without calling str(arr).
2371 arrays to print a more useful summary, without calling str(arr).
2366 This avoids the problem of extremely lengthy computations which
2372 This avoids the problem of extremely lengthy computations which
2367 occur if arr is large, and appear to the user as a system lockup
2373 occur if arr is large, and appear to the user as a system lockup
2368 with 100% cpu activity. After a suggestion by Kristian Sandberg
2374 with 100% cpu activity. After a suggestion by Kristian Sandberg
2369 <Kristian.Sandberg@colorado.edu>.
2375 <Kristian.Sandberg@colorado.edu>.
2370 (Magic.__init__): fix bug in global magic escapes not being
2376 (Magic.__init__): fix bug in global magic escapes not being
2371 correctly set.
2377 correctly set.
2372
2378
2373 2004-10-08 Fernando Perez <fperez@colorado.edu>
2379 2004-10-08 Fernando Perez <fperez@colorado.edu>
2374
2380
2375 * IPython/Magic.py (__license__): change to absolute imports of
2381 * IPython/Magic.py (__license__): change to absolute imports of
2376 ipython's own internal packages, to start adapting to the absolute
2382 ipython's own internal packages, to start adapting to the absolute
2377 import requirement of PEP-328.
2383 import requirement of PEP-328.
2378
2384
2379 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2385 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2380 files, and standardize author/license marks through the Release
2386 files, and standardize author/license marks through the Release
2381 module instead of having per/file stuff (except for files with
2387 module instead of having per/file stuff (except for files with
2382 particular licenses, like the MIT/PSF-licensed codes).
2388 particular licenses, like the MIT/PSF-licensed codes).
2383
2389
2384 * IPython/Debugger.py: remove dead code for python 2.1
2390 * IPython/Debugger.py: remove dead code for python 2.1
2385
2391
2386 2004-10-04 Fernando Perez <fperez@colorado.edu>
2392 2004-10-04 Fernando Perez <fperez@colorado.edu>
2387
2393
2388 * IPython/iplib.py (ipmagic): New function for accessing magics
2394 * IPython/iplib.py (ipmagic): New function for accessing magics
2389 via a normal python function call.
2395 via a normal python function call.
2390
2396
2391 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2397 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2392 from '@' to '%', to accomodate the new @decorator syntax of python
2398 from '@' to '%', to accomodate the new @decorator syntax of python
2393 2.4.
2399 2.4.
2394
2400
2395 2004-09-29 Fernando Perez <fperez@colorado.edu>
2401 2004-09-29 Fernando Perez <fperez@colorado.edu>
2396
2402
2397 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2403 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2398 matplotlib.use to prevent running scripts which try to switch
2404 matplotlib.use to prevent running scripts which try to switch
2399 interactive backends from within ipython. This will just crash
2405 interactive backends from within ipython. This will just crash
2400 the python interpreter, so we can't allow it (but a detailed error
2406 the python interpreter, so we can't allow it (but a detailed error
2401 is given to the user).
2407 is given to the user).
2402
2408
2403 2004-09-28 Fernando Perez <fperez@colorado.edu>
2409 2004-09-28 Fernando Perez <fperez@colorado.edu>
2404
2410
2405 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2411 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2406 matplotlib-related fixes so that using @run with non-matplotlib
2412 matplotlib-related fixes so that using @run with non-matplotlib
2407 scripts doesn't pop up spurious plot windows. This requires
2413 scripts doesn't pop up spurious plot windows. This requires
2408 matplotlib >= 0.63, where I had to make some changes as well.
2414 matplotlib >= 0.63, where I had to make some changes as well.
2409
2415
2410 * IPython/ipmaker.py (make_IPython): update version requirement to
2416 * IPython/ipmaker.py (make_IPython): update version requirement to
2411 python 2.2.
2417 python 2.2.
2412
2418
2413 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2419 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2414 banner arg for embedded customization.
2420 banner arg for embedded customization.
2415
2421
2416 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2422 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2417 explicit uses of __IP as the IPython's instance name. Now things
2423 explicit uses of __IP as the IPython's instance name. Now things
2418 are properly handled via the shell.name value. The actual code
2424 are properly handled via the shell.name value. The actual code
2419 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2425 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2420 is much better than before. I'll clean things completely when the
2426 is much better than before. I'll clean things completely when the
2421 magic stuff gets a real overhaul.
2427 magic stuff gets a real overhaul.
2422
2428
2423 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2429 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2424 minor changes to debian dir.
2430 minor changes to debian dir.
2425
2431
2426 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2432 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2427 pointer to the shell itself in the interactive namespace even when
2433 pointer to the shell itself in the interactive namespace even when
2428 a user-supplied dict is provided. This is needed for embedding
2434 a user-supplied dict is provided. This is needed for embedding
2429 purposes (found by tests with Michel Sanner).
2435 purposes (found by tests with Michel Sanner).
2430
2436
2431 2004-09-27 Fernando Perez <fperez@colorado.edu>
2437 2004-09-27 Fernando Perez <fperez@colorado.edu>
2432
2438
2433 * IPython/UserConfig/ipythonrc: remove []{} from
2439 * IPython/UserConfig/ipythonrc: remove []{} from
2434 readline_remove_delims, so that things like [modname.<TAB> do
2440 readline_remove_delims, so that things like [modname.<TAB> do
2435 proper completion. This disables [].TAB, but that's a less common
2441 proper completion. This disables [].TAB, but that's a less common
2436 case than module names in list comprehensions, for example.
2442 case than module names in list comprehensions, for example.
2437 Thanks to a report by Andrea Riciputi.
2443 Thanks to a report by Andrea Riciputi.
2438
2444
2439 2004-09-09 Fernando Perez <fperez@colorado.edu>
2445 2004-09-09 Fernando Perez <fperez@colorado.edu>
2440
2446
2441 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2447 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2442 blocking problems in win32 and osx. Fix by John.
2448 blocking problems in win32 and osx. Fix by John.
2443
2449
2444 2004-09-08 Fernando Perez <fperez@colorado.edu>
2450 2004-09-08 Fernando Perez <fperez@colorado.edu>
2445
2451
2446 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2452 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2447 for Win32 and OSX. Fix by John Hunter.
2453 for Win32 and OSX. Fix by John Hunter.
2448
2454
2449 2004-08-30 *** Released version 0.6.3
2455 2004-08-30 *** Released version 0.6.3
2450
2456
2451 2004-08-30 Fernando Perez <fperez@colorado.edu>
2457 2004-08-30 Fernando Perez <fperez@colorado.edu>
2452
2458
2453 * setup.py (isfile): Add manpages to list of dependent files to be
2459 * setup.py (isfile): Add manpages to list of dependent files to be
2454 updated.
2460 updated.
2455
2461
2456 2004-08-27 Fernando Perez <fperez@colorado.edu>
2462 2004-08-27 Fernando Perez <fperez@colorado.edu>
2457
2463
2458 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2464 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2459 for now. They don't really work with standalone WX/GTK code
2465 for now. They don't really work with standalone WX/GTK code
2460 (though matplotlib IS working fine with both of those backends).
2466 (though matplotlib IS working fine with both of those backends).
2461 This will neeed much more testing. I disabled most things with
2467 This will neeed much more testing. I disabled most things with
2462 comments, so turning it back on later should be pretty easy.
2468 comments, so turning it back on later should be pretty easy.
2463
2469
2464 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2470 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2465 autocalling of expressions like r'foo', by modifying the line
2471 autocalling of expressions like r'foo', by modifying the line
2466 split regexp. Closes
2472 split regexp. Closes
2467 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2473 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2468 Riley <ipythonbugs-AT-sabi.net>.
2474 Riley <ipythonbugs-AT-sabi.net>.
2469 (InteractiveShell.mainloop): honor --nobanner with banner
2475 (InteractiveShell.mainloop): honor --nobanner with banner
2470 extensions.
2476 extensions.
2471
2477
2472 * IPython/Shell.py: Significant refactoring of all classes, so
2478 * IPython/Shell.py: Significant refactoring of all classes, so
2473 that we can really support ALL matplotlib backends and threading
2479 that we can really support ALL matplotlib backends and threading
2474 models (John spotted a bug with Tk which required this). Now we
2480 models (John spotted a bug with Tk which required this). Now we
2475 should support single-threaded, WX-threads and GTK-threads, both
2481 should support single-threaded, WX-threads and GTK-threads, both
2476 for generic code and for matplotlib.
2482 for generic code and for matplotlib.
2477
2483
2478 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2484 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2479 -pylab, to simplify things for users. Will also remove the pylab
2485 -pylab, to simplify things for users. Will also remove the pylab
2480 profile, since now all of matplotlib configuration is directly
2486 profile, since now all of matplotlib configuration is directly
2481 handled here. This also reduces startup time.
2487 handled here. This also reduces startup time.
2482
2488
2483 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2489 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2484 shell wasn't being correctly called. Also in IPShellWX.
2490 shell wasn't being correctly called. Also in IPShellWX.
2485
2491
2486 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2492 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2487 fine-tune banner.
2493 fine-tune banner.
2488
2494
2489 * IPython/numutils.py (spike): Deprecate these spike functions,
2495 * IPython/numutils.py (spike): Deprecate these spike functions,
2490 delete (long deprecated) gnuplot_exec handler.
2496 delete (long deprecated) gnuplot_exec handler.
2491
2497
2492 2004-08-26 Fernando Perez <fperez@colorado.edu>
2498 2004-08-26 Fernando Perez <fperez@colorado.edu>
2493
2499
2494 * ipython.1: Update for threading options, plus some others which
2500 * ipython.1: Update for threading options, plus some others which
2495 were missing.
2501 were missing.
2496
2502
2497 * IPython/ipmaker.py (__call__): Added -wthread option for
2503 * IPython/ipmaker.py (__call__): Added -wthread option for
2498 wxpython thread handling. Make sure threading options are only
2504 wxpython thread handling. Make sure threading options are only
2499 valid at the command line.
2505 valid at the command line.
2500
2506
2501 * scripts/ipython: moved shell selection into a factory function
2507 * scripts/ipython: moved shell selection into a factory function
2502 in Shell.py, to keep the starter script to a minimum.
2508 in Shell.py, to keep the starter script to a minimum.
2503
2509
2504 2004-08-25 Fernando Perez <fperez@colorado.edu>
2510 2004-08-25 Fernando Perez <fperez@colorado.edu>
2505
2511
2506 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2512 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2507 John. Along with some recent changes he made to matplotlib, the
2513 John. Along with some recent changes he made to matplotlib, the
2508 next versions of both systems should work very well together.
2514 next versions of both systems should work very well together.
2509
2515
2510 2004-08-24 Fernando Perez <fperez@colorado.edu>
2516 2004-08-24 Fernando Perez <fperez@colorado.edu>
2511
2517
2512 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2518 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2513 tried to switch the profiling to using hotshot, but I'm getting
2519 tried to switch the profiling to using hotshot, but I'm getting
2514 strange errors from prof.runctx() there. I may be misreading the
2520 strange errors from prof.runctx() there. I may be misreading the
2515 docs, but it looks weird. For now the profiling code will
2521 docs, but it looks weird. For now the profiling code will
2516 continue to use the standard profiler.
2522 continue to use the standard profiler.
2517
2523
2518 2004-08-23 Fernando Perez <fperez@colorado.edu>
2524 2004-08-23 Fernando Perez <fperez@colorado.edu>
2519
2525
2520 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2526 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2521 threaded shell, by John Hunter. It's not quite ready yet, but
2527 threaded shell, by John Hunter. It's not quite ready yet, but
2522 close.
2528 close.
2523
2529
2524 2004-08-22 Fernando Perez <fperez@colorado.edu>
2530 2004-08-22 Fernando Perez <fperez@colorado.edu>
2525
2531
2526 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2532 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2527 in Magic and ultraTB.
2533 in Magic and ultraTB.
2528
2534
2529 * ipython.1: document threading options in manpage.
2535 * ipython.1: document threading options in manpage.
2530
2536
2531 * scripts/ipython: Changed name of -thread option to -gthread,
2537 * scripts/ipython: Changed name of -thread option to -gthread,
2532 since this is GTK specific. I want to leave the door open for a
2538 since this is GTK specific. I want to leave the door open for a
2533 -wthread option for WX, which will most likely be necessary. This
2539 -wthread option for WX, which will most likely be necessary. This
2534 change affects usage and ipmaker as well.
2540 change affects usage and ipmaker as well.
2535
2541
2536 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2542 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2537 handle the matplotlib shell issues. Code by John Hunter
2543 handle the matplotlib shell issues. Code by John Hunter
2538 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2544 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2539 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2545 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2540 broken (and disabled for end users) for now, but it puts the
2546 broken (and disabled for end users) for now, but it puts the
2541 infrastructure in place.
2547 infrastructure in place.
2542
2548
2543 2004-08-21 Fernando Perez <fperez@colorado.edu>
2549 2004-08-21 Fernando Perez <fperez@colorado.edu>
2544
2550
2545 * ipythonrc-pylab: Add matplotlib support.
2551 * ipythonrc-pylab: Add matplotlib support.
2546
2552
2547 * matplotlib_config.py: new files for matplotlib support, part of
2553 * matplotlib_config.py: new files for matplotlib support, part of
2548 the pylab profile.
2554 the pylab profile.
2549
2555
2550 * IPython/usage.py (__doc__): documented the threading options.
2556 * IPython/usage.py (__doc__): documented the threading options.
2551
2557
2552 2004-08-20 Fernando Perez <fperez@colorado.edu>
2558 2004-08-20 Fernando Perez <fperez@colorado.edu>
2553
2559
2554 * ipython: Modified the main calling routine to handle the -thread
2560 * ipython: Modified the main calling routine to handle the -thread
2555 and -mpthread options. This needs to be done as a top-level hack,
2561 and -mpthread options. This needs to be done as a top-level hack,
2556 because it determines which class to instantiate for IPython
2562 because it determines which class to instantiate for IPython
2557 itself.
2563 itself.
2558
2564
2559 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2565 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2560 classes to support multithreaded GTK operation without blocking,
2566 classes to support multithreaded GTK operation without blocking,
2561 and matplotlib with all backends. This is a lot of still very
2567 and matplotlib with all backends. This is a lot of still very
2562 experimental code, and threads are tricky. So it may still have a
2568 experimental code, and threads are tricky. So it may still have a
2563 few rough edges... This code owes a lot to
2569 few rough edges... This code owes a lot to
2564 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2570 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2565 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2571 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2566 to John Hunter for all the matplotlib work.
2572 to John Hunter for all the matplotlib work.
2567
2573
2568 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2574 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2569 options for gtk thread and matplotlib support.
2575 options for gtk thread and matplotlib support.
2570
2576
2571 2004-08-16 Fernando Perez <fperez@colorado.edu>
2577 2004-08-16 Fernando Perez <fperez@colorado.edu>
2572
2578
2573 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2579 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2574 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2580 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2575 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2581 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2576
2582
2577 2004-08-11 Fernando Perez <fperez@colorado.edu>
2583 2004-08-11 Fernando Perez <fperez@colorado.edu>
2578
2584
2579 * setup.py (isfile): Fix build so documentation gets updated for
2585 * setup.py (isfile): Fix build so documentation gets updated for
2580 rpms (it was only done for .tgz builds).
2586 rpms (it was only done for .tgz builds).
2581
2587
2582 2004-08-10 Fernando Perez <fperez@colorado.edu>
2588 2004-08-10 Fernando Perez <fperez@colorado.edu>
2583
2589
2584 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2590 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2585
2591
2586 * iplib.py : Silence syntax error exceptions in tab-completion.
2592 * iplib.py : Silence syntax error exceptions in tab-completion.
2587
2593
2588 2004-08-05 Fernando Perez <fperez@colorado.edu>
2594 2004-08-05 Fernando Perez <fperez@colorado.edu>
2589
2595
2590 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2596 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2591 'color off' mark for continuation prompts. This was causing long
2597 'color off' mark for continuation prompts. This was causing long
2592 continuation lines to mis-wrap.
2598 continuation lines to mis-wrap.
2593
2599
2594 2004-08-01 Fernando Perez <fperez@colorado.edu>
2600 2004-08-01 Fernando Perez <fperez@colorado.edu>
2595
2601
2596 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2602 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2597 for building ipython to be a parameter. All this is necessary
2603 for building ipython to be a parameter. All this is necessary
2598 right now to have a multithreaded version, but this insane
2604 right now to have a multithreaded version, but this insane
2599 non-design will be cleaned up soon. For now, it's a hack that
2605 non-design will be cleaned up soon. For now, it's a hack that
2600 works.
2606 works.
2601
2607
2602 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2608 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2603 args in various places. No bugs so far, but it's a dangerous
2609 args in various places. No bugs so far, but it's a dangerous
2604 practice.
2610 practice.
2605
2611
2606 2004-07-31 Fernando Perez <fperez@colorado.edu>
2612 2004-07-31 Fernando Perez <fperez@colorado.edu>
2607
2613
2608 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2614 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2609 fix completion of files with dots in their names under most
2615 fix completion of files with dots in their names under most
2610 profiles (pysh was OK because the completion order is different).
2616 profiles (pysh was OK because the completion order is different).
2611
2617
2612 2004-07-27 Fernando Perez <fperez@colorado.edu>
2618 2004-07-27 Fernando Perez <fperez@colorado.edu>
2613
2619
2614 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2620 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2615 keywords manually, b/c the one in keyword.py was removed in python
2621 keywords manually, b/c the one in keyword.py was removed in python
2616 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2622 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2617 This is NOT a bug under python 2.3 and earlier.
2623 This is NOT a bug under python 2.3 and earlier.
2618
2624
2619 2004-07-26 Fernando Perez <fperez@colorado.edu>
2625 2004-07-26 Fernando Perez <fperez@colorado.edu>
2620
2626
2621 * IPython/ultraTB.py (VerboseTB.text): Add another
2627 * IPython/ultraTB.py (VerboseTB.text): Add another
2622 linecache.checkcache() call to try to prevent inspect.py from
2628 linecache.checkcache() call to try to prevent inspect.py from
2623 crashing under python 2.3. I think this fixes
2629 crashing under python 2.3. I think this fixes
2624 http://www.scipy.net/roundup/ipython/issue17.
2630 http://www.scipy.net/roundup/ipython/issue17.
2625
2631
2626 2004-07-26 *** Released version 0.6.2
2632 2004-07-26 *** Released version 0.6.2
2627
2633
2628 2004-07-26 Fernando Perez <fperez@colorado.edu>
2634 2004-07-26 Fernando Perez <fperez@colorado.edu>
2629
2635
2630 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2636 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2631 fail for any number.
2637 fail for any number.
2632 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2638 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2633 empty bookmarks.
2639 empty bookmarks.
2634
2640
2635 2004-07-26 *** Released version 0.6.1
2641 2004-07-26 *** Released version 0.6.1
2636
2642
2637 2004-07-26 Fernando Perez <fperez@colorado.edu>
2643 2004-07-26 Fernando Perez <fperez@colorado.edu>
2638
2644
2639 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2645 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2640
2646
2641 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2647 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2642 escaping '()[]{}' in filenames.
2648 escaping '()[]{}' in filenames.
2643
2649
2644 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2650 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2645 Python 2.2 users who lack a proper shlex.split.
2651 Python 2.2 users who lack a proper shlex.split.
2646
2652
2647 2004-07-19 Fernando Perez <fperez@colorado.edu>
2653 2004-07-19 Fernando Perez <fperez@colorado.edu>
2648
2654
2649 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2655 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2650 for reading readline's init file. I follow the normal chain:
2656 for reading readline's init file. I follow the normal chain:
2651 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2657 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2652 report by Mike Heeter. This closes
2658 report by Mike Heeter. This closes
2653 http://www.scipy.net/roundup/ipython/issue16.
2659 http://www.scipy.net/roundup/ipython/issue16.
2654
2660
2655 2004-07-18 Fernando Perez <fperez@colorado.edu>
2661 2004-07-18 Fernando Perez <fperez@colorado.edu>
2656
2662
2657 * IPython/iplib.py (__init__): Add better handling of '\' under
2663 * IPython/iplib.py (__init__): Add better handling of '\' under
2658 Win32 for filenames. After a patch by Ville.
2664 Win32 for filenames. After a patch by Ville.
2659
2665
2660 2004-07-17 Fernando Perez <fperez@colorado.edu>
2666 2004-07-17 Fernando Perez <fperez@colorado.edu>
2661
2667
2662 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2668 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2663 autocalling would be triggered for 'foo is bar' if foo is
2669 autocalling would be triggered for 'foo is bar' if foo is
2664 callable. I also cleaned up the autocall detection code to use a
2670 callable. I also cleaned up the autocall detection code to use a
2665 regexp, which is faster. Bug reported by Alexander Schmolck.
2671 regexp, which is faster. Bug reported by Alexander Schmolck.
2666
2672
2667 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2673 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2668 '?' in them would confuse the help system. Reported by Alex
2674 '?' in them would confuse the help system. Reported by Alex
2669 Schmolck.
2675 Schmolck.
2670
2676
2671 2004-07-16 Fernando Perez <fperez@colorado.edu>
2677 2004-07-16 Fernando Perez <fperez@colorado.edu>
2672
2678
2673 * IPython/GnuplotInteractive.py (__all__): added plot2.
2679 * IPython/GnuplotInteractive.py (__all__): added plot2.
2674
2680
2675 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2681 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2676 plotting dictionaries, lists or tuples of 1d arrays.
2682 plotting dictionaries, lists or tuples of 1d arrays.
2677
2683
2678 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2684 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2679 optimizations.
2685 optimizations.
2680
2686
2681 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2687 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2682 the information which was there from Janko's original IPP code:
2688 the information which was there from Janko's original IPP code:
2683
2689
2684 03.05.99 20:53 porto.ifm.uni-kiel.de
2690 03.05.99 20:53 porto.ifm.uni-kiel.de
2685 --Started changelog.
2691 --Started changelog.
2686 --make clear do what it say it does
2692 --make clear do what it say it does
2687 --added pretty output of lines from inputcache
2693 --added pretty output of lines from inputcache
2688 --Made Logger a mixin class, simplifies handling of switches
2694 --Made Logger a mixin class, simplifies handling of switches
2689 --Added own completer class. .string<TAB> expands to last history
2695 --Added own completer class. .string<TAB> expands to last history
2690 line which starts with string. The new expansion is also present
2696 line which starts with string. The new expansion is also present
2691 with Ctrl-r from the readline library. But this shows, who this
2697 with Ctrl-r from the readline library. But this shows, who this
2692 can be done for other cases.
2698 can be done for other cases.
2693 --Added convention that all shell functions should accept a
2699 --Added convention that all shell functions should accept a
2694 parameter_string This opens the door for different behaviour for
2700 parameter_string This opens the door for different behaviour for
2695 each function. @cd is a good example of this.
2701 each function. @cd is a good example of this.
2696
2702
2697 04.05.99 12:12 porto.ifm.uni-kiel.de
2703 04.05.99 12:12 porto.ifm.uni-kiel.de
2698 --added logfile rotation
2704 --added logfile rotation
2699 --added new mainloop method which freezes first the namespace
2705 --added new mainloop method which freezes first the namespace
2700
2706
2701 07.05.99 21:24 porto.ifm.uni-kiel.de
2707 07.05.99 21:24 porto.ifm.uni-kiel.de
2702 --added the docreader classes. Now there is a help system.
2708 --added the docreader classes. Now there is a help system.
2703 -This is only a first try. Currently it's not easy to put new
2709 -This is only a first try. Currently it's not easy to put new
2704 stuff in the indices. But this is the way to go. Info would be
2710 stuff in the indices. But this is the way to go. Info would be
2705 better, but HTML is every where and not everybody has an info
2711 better, but HTML is every where and not everybody has an info
2706 system installed and it's not so easy to change html-docs to info.
2712 system installed and it's not so easy to change html-docs to info.
2707 --added global logfile option
2713 --added global logfile option
2708 --there is now a hook for object inspection method pinfo needs to
2714 --there is now a hook for object inspection method pinfo needs to
2709 be provided for this. Can be reached by two '??'.
2715 be provided for this. Can be reached by two '??'.
2710
2716
2711 08.05.99 20:51 porto.ifm.uni-kiel.de
2717 08.05.99 20:51 porto.ifm.uni-kiel.de
2712 --added a README
2718 --added a README
2713 --bug in rc file. Something has changed so functions in the rc
2719 --bug in rc file. Something has changed so functions in the rc
2714 file need to reference the shell and not self. Not clear if it's a
2720 file need to reference the shell and not self. Not clear if it's a
2715 bug or feature.
2721 bug or feature.
2716 --changed rc file for new behavior
2722 --changed rc file for new behavior
2717
2723
2718 2004-07-15 Fernando Perez <fperez@colorado.edu>
2724 2004-07-15 Fernando Perez <fperez@colorado.edu>
2719
2725
2720 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2726 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2721 cache was falling out of sync in bizarre manners when multi-line
2727 cache was falling out of sync in bizarre manners when multi-line
2722 input was present. Minor optimizations and cleanup.
2728 input was present. Minor optimizations and cleanup.
2723
2729
2724 (Logger): Remove old Changelog info for cleanup. This is the
2730 (Logger): Remove old Changelog info for cleanup. This is the
2725 information which was there from Janko's original code:
2731 information which was there from Janko's original code:
2726
2732
2727 Changes to Logger: - made the default log filename a parameter
2733 Changes to Logger: - made the default log filename a parameter
2728
2734
2729 - put a check for lines beginning with !@? in log(). Needed
2735 - put a check for lines beginning with !@? in log(). Needed
2730 (even if the handlers properly log their lines) for mid-session
2736 (even if the handlers properly log their lines) for mid-session
2731 logging activation to work properly. Without this, lines logged
2737 logging activation to work properly. Without this, lines logged
2732 in mid session, which get read from the cache, would end up
2738 in mid session, which get read from the cache, would end up
2733 'bare' (with !@? in the open) in the log. Now they are caught
2739 'bare' (with !@? in the open) in the log. Now they are caught
2734 and prepended with a #.
2740 and prepended with a #.
2735
2741
2736 * IPython/iplib.py (InteractiveShell.init_readline): added check
2742 * IPython/iplib.py (InteractiveShell.init_readline): added check
2737 in case MagicCompleter fails to be defined, so we don't crash.
2743 in case MagicCompleter fails to be defined, so we don't crash.
2738
2744
2739 2004-07-13 Fernando Perez <fperez@colorado.edu>
2745 2004-07-13 Fernando Perez <fperez@colorado.edu>
2740
2746
2741 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2747 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2742 of EPS if the requested filename ends in '.eps'.
2748 of EPS if the requested filename ends in '.eps'.
2743
2749
2744 2004-07-04 Fernando Perez <fperez@colorado.edu>
2750 2004-07-04 Fernando Perez <fperez@colorado.edu>
2745
2751
2746 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2752 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2747 escaping of quotes when calling the shell.
2753 escaping of quotes when calling the shell.
2748
2754
2749 2004-07-02 Fernando Perez <fperez@colorado.edu>
2755 2004-07-02 Fernando Perez <fperez@colorado.edu>
2750
2756
2751 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2757 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2752 gettext not working because we were clobbering '_'. Fixes
2758 gettext not working because we were clobbering '_'. Fixes
2753 http://www.scipy.net/roundup/ipython/issue6.
2759 http://www.scipy.net/roundup/ipython/issue6.
2754
2760
2755 2004-07-01 Fernando Perez <fperez@colorado.edu>
2761 2004-07-01 Fernando Perez <fperez@colorado.edu>
2756
2762
2757 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2763 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2758 into @cd. Patch by Ville.
2764 into @cd. Patch by Ville.
2759
2765
2760 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2766 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2761 new function to store things after ipmaker runs. Patch by Ville.
2767 new function to store things after ipmaker runs. Patch by Ville.
2762 Eventually this will go away once ipmaker is removed and the class
2768 Eventually this will go away once ipmaker is removed and the class
2763 gets cleaned up, but for now it's ok. Key functionality here is
2769 gets cleaned up, but for now it's ok. Key functionality here is
2764 the addition of the persistent storage mechanism, a dict for
2770 the addition of the persistent storage mechanism, a dict for
2765 keeping data across sessions (for now just bookmarks, but more can
2771 keeping data across sessions (for now just bookmarks, but more can
2766 be implemented later).
2772 be implemented later).
2767
2773
2768 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2774 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2769 persistent across sections. Patch by Ville, I modified it
2775 persistent across sections. Patch by Ville, I modified it
2770 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2776 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2771 added a '-l' option to list all bookmarks.
2777 added a '-l' option to list all bookmarks.
2772
2778
2773 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2779 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2774 center for cleanup. Registered with atexit.register(). I moved
2780 center for cleanup. Registered with atexit.register(). I moved
2775 here the old exit_cleanup(). After a patch by Ville.
2781 here the old exit_cleanup(). After a patch by Ville.
2776
2782
2777 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2783 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2778 characters in the hacked shlex_split for python 2.2.
2784 characters in the hacked shlex_split for python 2.2.
2779
2785
2780 * IPython/iplib.py (file_matches): more fixes to filenames with
2786 * IPython/iplib.py (file_matches): more fixes to filenames with
2781 whitespace in them. It's not perfect, but limitations in python's
2787 whitespace in them. It's not perfect, but limitations in python's
2782 readline make it impossible to go further.
2788 readline make it impossible to go further.
2783
2789
2784 2004-06-29 Fernando Perez <fperez@colorado.edu>
2790 2004-06-29 Fernando Perez <fperez@colorado.edu>
2785
2791
2786 * IPython/iplib.py (file_matches): escape whitespace correctly in
2792 * IPython/iplib.py (file_matches): escape whitespace correctly in
2787 filename completions. Bug reported by Ville.
2793 filename completions. Bug reported by Ville.
2788
2794
2789 2004-06-28 Fernando Perez <fperez@colorado.edu>
2795 2004-06-28 Fernando Perez <fperez@colorado.edu>
2790
2796
2791 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2797 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2792 the history file will be called 'history-PROFNAME' (or just
2798 the history file will be called 'history-PROFNAME' (or just
2793 'history' if no profile is loaded). I was getting annoyed at
2799 'history' if no profile is loaded). I was getting annoyed at
2794 getting my Numerical work history clobbered by pysh sessions.
2800 getting my Numerical work history clobbered by pysh sessions.
2795
2801
2796 * IPython/iplib.py (InteractiveShell.__init__): Internal
2802 * IPython/iplib.py (InteractiveShell.__init__): Internal
2797 getoutputerror() function so that we can honor the system_verbose
2803 getoutputerror() function so that we can honor the system_verbose
2798 flag for _all_ system calls. I also added escaping of #
2804 flag for _all_ system calls. I also added escaping of #
2799 characters here to avoid confusing Itpl.
2805 characters here to avoid confusing Itpl.
2800
2806
2801 * IPython/Magic.py (shlex_split): removed call to shell in
2807 * IPython/Magic.py (shlex_split): removed call to shell in
2802 parse_options and replaced it with shlex.split(). The annoying
2808 parse_options and replaced it with shlex.split(). The annoying
2803 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2809 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2804 to backport it from 2.3, with several frail hacks (the shlex
2810 to backport it from 2.3, with several frail hacks (the shlex
2805 module is rather limited in 2.2). Thanks to a suggestion by Ville
2811 module is rather limited in 2.2). Thanks to a suggestion by Ville
2806 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2812 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2807 problem.
2813 problem.
2808
2814
2809 (Magic.magic_system_verbose): new toggle to print the actual
2815 (Magic.magic_system_verbose): new toggle to print the actual
2810 system calls made by ipython. Mainly for debugging purposes.
2816 system calls made by ipython. Mainly for debugging purposes.
2811
2817
2812 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2818 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2813 doesn't support persistence. Reported (and fix suggested) by
2819 doesn't support persistence. Reported (and fix suggested) by
2814 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2820 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2815
2821
2816 2004-06-26 Fernando Perez <fperez@colorado.edu>
2822 2004-06-26 Fernando Perez <fperez@colorado.edu>
2817
2823
2818 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2824 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2819 continue prompts.
2825 continue prompts.
2820
2826
2821 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2827 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2822 function (basically a big docstring) and a few more things here to
2828 function (basically a big docstring) and a few more things here to
2823 speedup startup. pysh.py is now very lightweight. We want because
2829 speedup startup. pysh.py is now very lightweight. We want because
2824 it gets execfile'd, while InterpreterExec gets imported, so
2830 it gets execfile'd, while InterpreterExec gets imported, so
2825 byte-compilation saves time.
2831 byte-compilation saves time.
2826
2832
2827 2004-06-25 Fernando Perez <fperez@colorado.edu>
2833 2004-06-25 Fernando Perez <fperez@colorado.edu>
2828
2834
2829 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2835 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2830 -NUM', which was recently broken.
2836 -NUM', which was recently broken.
2831
2837
2832 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2838 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2833 in multi-line input (but not !!, which doesn't make sense there).
2839 in multi-line input (but not !!, which doesn't make sense there).
2834
2840
2835 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2841 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2836 It's just too useful, and people can turn it off in the less
2842 It's just too useful, and people can turn it off in the less
2837 common cases where it's a problem.
2843 common cases where it's a problem.
2838
2844
2839 2004-06-24 Fernando Perez <fperez@colorado.edu>
2845 2004-06-24 Fernando Perez <fperez@colorado.edu>
2840
2846
2841 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2847 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2842 special syntaxes (like alias calling) is now allied in multi-line
2848 special syntaxes (like alias calling) is now allied in multi-line
2843 input. This is still _very_ experimental, but it's necessary for
2849 input. This is still _very_ experimental, but it's necessary for
2844 efficient shell usage combining python looping syntax with system
2850 efficient shell usage combining python looping syntax with system
2845 calls. For now it's restricted to aliases, I don't think it
2851 calls. For now it's restricted to aliases, I don't think it
2846 really even makes sense to have this for magics.
2852 really even makes sense to have this for magics.
2847
2853
2848 2004-06-23 Fernando Perez <fperez@colorado.edu>
2854 2004-06-23 Fernando Perez <fperez@colorado.edu>
2849
2855
2850 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2856 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2851 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2857 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2852
2858
2853 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2859 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2854 extensions under Windows (after code sent by Gary Bishop). The
2860 extensions under Windows (after code sent by Gary Bishop). The
2855 extensions considered 'executable' are stored in IPython's rc
2861 extensions considered 'executable' are stored in IPython's rc
2856 structure as win_exec_ext.
2862 structure as win_exec_ext.
2857
2863
2858 * IPython/genutils.py (shell): new function, like system() but
2864 * IPython/genutils.py (shell): new function, like system() but
2859 without return value. Very useful for interactive shell work.
2865 without return value. Very useful for interactive shell work.
2860
2866
2861 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2867 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2862 delete aliases.
2868 delete aliases.
2863
2869
2864 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2870 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2865 sure that the alias table doesn't contain python keywords.
2871 sure that the alias table doesn't contain python keywords.
2866
2872
2867 2004-06-21 Fernando Perez <fperez@colorado.edu>
2873 2004-06-21 Fernando Perez <fperez@colorado.edu>
2868
2874
2869 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2875 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2870 non-existent items are found in $PATH. Reported by Thorsten.
2876 non-existent items are found in $PATH. Reported by Thorsten.
2871
2877
2872 2004-06-20 Fernando Perez <fperez@colorado.edu>
2878 2004-06-20 Fernando Perez <fperez@colorado.edu>
2873
2879
2874 * IPython/iplib.py (complete): modified the completer so that the
2880 * IPython/iplib.py (complete): modified the completer so that the
2875 order of priorities can be easily changed at runtime.
2881 order of priorities can be easily changed at runtime.
2876
2882
2877 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2883 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2878 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2884 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2879
2885
2880 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2886 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2881 expand Python variables prepended with $ in all system calls. The
2887 expand Python variables prepended with $ in all system calls. The
2882 same was done to InteractiveShell.handle_shell_escape. Now all
2888 same was done to InteractiveShell.handle_shell_escape. Now all
2883 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2889 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2884 expansion of python variables and expressions according to the
2890 expansion of python variables and expressions according to the
2885 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2891 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2886
2892
2887 Though PEP-215 has been rejected, a similar (but simpler) one
2893 Though PEP-215 has been rejected, a similar (but simpler) one
2888 seems like it will go into Python 2.4, PEP-292 -
2894 seems like it will go into Python 2.4, PEP-292 -
2889 http://www.python.org/peps/pep-0292.html.
2895 http://www.python.org/peps/pep-0292.html.
2890
2896
2891 I'll keep the full syntax of PEP-215, since IPython has since the
2897 I'll keep the full syntax of PEP-215, since IPython has since the
2892 start used Ka-Ping Yee's reference implementation discussed there
2898 start used Ka-Ping Yee's reference implementation discussed there
2893 (Itpl), and I actually like the powerful semantics it offers.
2899 (Itpl), and I actually like the powerful semantics it offers.
2894
2900
2895 In order to access normal shell variables, the $ has to be escaped
2901 In order to access normal shell variables, the $ has to be escaped
2896 via an extra $. For example:
2902 via an extra $. For example:
2897
2903
2898 In [7]: PATH='a python variable'
2904 In [7]: PATH='a python variable'
2899
2905
2900 In [8]: !echo $PATH
2906 In [8]: !echo $PATH
2901 a python variable
2907 a python variable
2902
2908
2903 In [9]: !echo $$PATH
2909 In [9]: !echo $$PATH
2904 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2910 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2905
2911
2906 (Magic.parse_options): escape $ so the shell doesn't evaluate
2912 (Magic.parse_options): escape $ so the shell doesn't evaluate
2907 things prematurely.
2913 things prematurely.
2908
2914
2909 * IPython/iplib.py (InteractiveShell.call_alias): added the
2915 * IPython/iplib.py (InteractiveShell.call_alias): added the
2910 ability for aliases to expand python variables via $.
2916 ability for aliases to expand python variables via $.
2911
2917
2912 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2918 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2913 system, now there's a @rehash/@rehashx pair of magics. These work
2919 system, now there's a @rehash/@rehashx pair of magics. These work
2914 like the csh rehash command, and can be invoked at any time. They
2920 like the csh rehash command, and can be invoked at any time. They
2915 build a table of aliases to everything in the user's $PATH
2921 build a table of aliases to everything in the user's $PATH
2916 (@rehash uses everything, @rehashx is slower but only adds
2922 (@rehash uses everything, @rehashx is slower but only adds
2917 executable files). With this, the pysh.py-based shell profile can
2923 executable files). With this, the pysh.py-based shell profile can
2918 now simply call rehash upon startup, and full access to all
2924 now simply call rehash upon startup, and full access to all
2919 programs in the user's path is obtained.
2925 programs in the user's path is obtained.
2920
2926
2921 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2927 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2922 functionality is now fully in place. I removed the old dynamic
2928 functionality is now fully in place. I removed the old dynamic
2923 code generation based approach, in favor of a much lighter one
2929 code generation based approach, in favor of a much lighter one
2924 based on a simple dict. The advantage is that this allows me to
2930 based on a simple dict. The advantage is that this allows me to
2925 now have thousands of aliases with negligible cost (unthinkable
2931 now have thousands of aliases with negligible cost (unthinkable
2926 with the old system).
2932 with the old system).
2927
2933
2928 2004-06-19 Fernando Perez <fperez@colorado.edu>
2934 2004-06-19 Fernando Perez <fperez@colorado.edu>
2929
2935
2930 * IPython/iplib.py (__init__): extended MagicCompleter class to
2936 * IPython/iplib.py (__init__): extended MagicCompleter class to
2931 also complete (last in priority) on user aliases.
2937 also complete (last in priority) on user aliases.
2932
2938
2933 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2939 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2934 call to eval.
2940 call to eval.
2935 (ItplNS.__init__): Added a new class which functions like Itpl,
2941 (ItplNS.__init__): Added a new class which functions like Itpl,
2936 but allows configuring the namespace for the evaluation to occur
2942 but allows configuring the namespace for the evaluation to occur
2937 in.
2943 in.
2938
2944
2939 2004-06-18 Fernando Perez <fperez@colorado.edu>
2945 2004-06-18 Fernando Perez <fperez@colorado.edu>
2940
2946
2941 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2947 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2942 better message when 'exit' or 'quit' are typed (a common newbie
2948 better message when 'exit' or 'quit' are typed (a common newbie
2943 confusion).
2949 confusion).
2944
2950
2945 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2951 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2946 check for Windows users.
2952 check for Windows users.
2947
2953
2948 * IPython/iplib.py (InteractiveShell.user_setup): removed
2954 * IPython/iplib.py (InteractiveShell.user_setup): removed
2949 disabling of colors for Windows. I'll test at runtime and issue a
2955 disabling of colors for Windows. I'll test at runtime and issue a
2950 warning if Gary's readline isn't found, as to nudge users to
2956 warning if Gary's readline isn't found, as to nudge users to
2951 download it.
2957 download it.
2952
2958
2953 2004-06-16 Fernando Perez <fperez@colorado.edu>
2959 2004-06-16 Fernando Perez <fperez@colorado.edu>
2954
2960
2955 * IPython/genutils.py (Stream.__init__): changed to print errors
2961 * IPython/genutils.py (Stream.__init__): changed to print errors
2956 to sys.stderr. I had a circular dependency here. Now it's
2962 to sys.stderr. I had a circular dependency here. Now it's
2957 possible to run ipython as IDLE's shell (consider this pre-alpha,
2963 possible to run ipython as IDLE's shell (consider this pre-alpha,
2958 since true stdout things end up in the starting terminal instead
2964 since true stdout things end up in the starting terminal instead
2959 of IDLE's out).
2965 of IDLE's out).
2960
2966
2961 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2967 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2962 users who haven't # updated their prompt_in2 definitions. Remove
2968 users who haven't # updated their prompt_in2 definitions. Remove
2963 eventually.
2969 eventually.
2964 (multiple_replace): added credit to original ASPN recipe.
2970 (multiple_replace): added credit to original ASPN recipe.
2965
2971
2966 2004-06-15 Fernando Perez <fperez@colorado.edu>
2972 2004-06-15 Fernando Perez <fperez@colorado.edu>
2967
2973
2968 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2974 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2969 list of auto-defined aliases.
2975 list of auto-defined aliases.
2970
2976
2971 2004-06-13 Fernando Perez <fperez@colorado.edu>
2977 2004-06-13 Fernando Perez <fperez@colorado.edu>
2972
2978
2973 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2979 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2974 install was really requested (so setup.py can be used for other
2980 install was really requested (so setup.py can be used for other
2975 things under Windows).
2981 things under Windows).
2976
2982
2977 2004-06-10 Fernando Perez <fperez@colorado.edu>
2983 2004-06-10 Fernando Perez <fperez@colorado.edu>
2978
2984
2979 * IPython/Logger.py (Logger.create_log): Manually remove any old
2985 * IPython/Logger.py (Logger.create_log): Manually remove any old
2980 backup, since os.remove may fail under Windows. Fixes bug
2986 backup, since os.remove may fail under Windows. Fixes bug
2981 reported by Thorsten.
2987 reported by Thorsten.
2982
2988
2983 2004-06-09 Fernando Perez <fperez@colorado.edu>
2989 2004-06-09 Fernando Perez <fperez@colorado.edu>
2984
2990
2985 * examples/example-embed.py: fixed all references to %n (replaced
2991 * examples/example-embed.py: fixed all references to %n (replaced
2986 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2992 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2987 for all examples and the manual as well.
2993 for all examples and the manual as well.
2988
2994
2989 2004-06-08 Fernando Perez <fperez@colorado.edu>
2995 2004-06-08 Fernando Perez <fperez@colorado.edu>
2990
2996
2991 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2997 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2992 alignment and color management. All 3 prompt subsystems now
2998 alignment and color management. All 3 prompt subsystems now
2993 inherit from BasePrompt.
2999 inherit from BasePrompt.
2994
3000
2995 * tools/release: updates for windows installer build and tag rpms
3001 * tools/release: updates for windows installer build and tag rpms
2996 with python version (since paths are fixed).
3002 with python version (since paths are fixed).
2997
3003
2998 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3004 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2999 which will become eventually obsolete. Also fixed the default
3005 which will become eventually obsolete. Also fixed the default
3000 prompt_in2 to use \D, so at least new users start with the correct
3006 prompt_in2 to use \D, so at least new users start with the correct
3001 defaults.
3007 defaults.
3002 WARNING: Users with existing ipythonrc files will need to apply
3008 WARNING: Users with existing ipythonrc files will need to apply
3003 this fix manually!
3009 this fix manually!
3004
3010
3005 * setup.py: make windows installer (.exe). This is finally the
3011 * setup.py: make windows installer (.exe). This is finally the
3006 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3012 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3007 which I hadn't included because it required Python 2.3 (or recent
3013 which I hadn't included because it required Python 2.3 (or recent
3008 distutils).
3014 distutils).
3009
3015
3010 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3016 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3011 usage of new '\D' escape.
3017 usage of new '\D' escape.
3012
3018
3013 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3019 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3014 lacks os.getuid())
3020 lacks os.getuid())
3015 (CachedOutput.set_colors): Added the ability to turn coloring
3021 (CachedOutput.set_colors): Added the ability to turn coloring
3016 on/off with @colors even for manually defined prompt colors. It
3022 on/off with @colors even for manually defined prompt colors. It
3017 uses a nasty global, but it works safely and via the generic color
3023 uses a nasty global, but it works safely and via the generic color
3018 handling mechanism.
3024 handling mechanism.
3019 (Prompt2.__init__): Introduced new escape '\D' for continuation
3025 (Prompt2.__init__): Introduced new escape '\D' for continuation
3020 prompts. It represents the counter ('\#') as dots.
3026 prompts. It represents the counter ('\#') as dots.
3021 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3027 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3022 need to update their ipythonrc files and replace '%n' with '\D' in
3028 need to update their ipythonrc files and replace '%n' with '\D' in
3023 their prompt_in2 settings everywhere. Sorry, but there's
3029 their prompt_in2 settings everywhere. Sorry, but there's
3024 otherwise no clean way to get all prompts to properly align. The
3030 otherwise no clean way to get all prompts to properly align. The
3025 ipythonrc shipped with IPython has been updated.
3031 ipythonrc shipped with IPython has been updated.
3026
3032
3027 2004-06-07 Fernando Perez <fperez@colorado.edu>
3033 2004-06-07 Fernando Perez <fperez@colorado.edu>
3028
3034
3029 * setup.py (isfile): Pass local_icons option to latex2html, so the
3035 * setup.py (isfile): Pass local_icons option to latex2html, so the
3030 resulting HTML file is self-contained. Thanks to
3036 resulting HTML file is self-contained. Thanks to
3031 dryice-AT-liu.com.cn for the tip.
3037 dryice-AT-liu.com.cn for the tip.
3032
3038
3033 * pysh.py: I created a new profile 'shell', which implements a
3039 * pysh.py: I created a new profile 'shell', which implements a
3034 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3040 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3035 system shell, nor will it become one anytime soon. It's mainly
3041 system shell, nor will it become one anytime soon. It's mainly
3036 meant to illustrate the use of the new flexible bash-like prompts.
3042 meant to illustrate the use of the new flexible bash-like prompts.
3037 I guess it could be used by hardy souls for true shell management,
3043 I guess it could be used by hardy souls for true shell management,
3038 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3044 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3039 profile. This uses the InterpreterExec extension provided by
3045 profile. This uses the InterpreterExec extension provided by
3040 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3046 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3041
3047
3042 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3048 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3043 auto-align itself with the length of the previous input prompt
3049 auto-align itself with the length of the previous input prompt
3044 (taking into account the invisible color escapes).
3050 (taking into account the invisible color escapes).
3045 (CachedOutput.__init__): Large restructuring of this class. Now
3051 (CachedOutput.__init__): Large restructuring of this class. Now
3046 all three prompts (primary1, primary2, output) are proper objects,
3052 all three prompts (primary1, primary2, output) are proper objects,
3047 managed by the 'parent' CachedOutput class. The code is still a
3053 managed by the 'parent' CachedOutput class. The code is still a
3048 bit hackish (all prompts share state via a pointer to the cache),
3054 bit hackish (all prompts share state via a pointer to the cache),
3049 but it's overall far cleaner than before.
3055 but it's overall far cleaner than before.
3050
3056
3051 * IPython/genutils.py (getoutputerror): modified to add verbose,
3057 * IPython/genutils.py (getoutputerror): modified to add verbose,
3052 debug and header options. This makes the interface of all getout*
3058 debug and header options. This makes the interface of all getout*
3053 functions uniform.
3059 functions uniform.
3054 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3060 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3055
3061
3056 * IPython/Magic.py (Magic.default_option): added a function to
3062 * IPython/Magic.py (Magic.default_option): added a function to
3057 allow registering default options for any magic command. This
3063 allow registering default options for any magic command. This
3058 makes it easy to have profiles which customize the magics globally
3064 makes it easy to have profiles which customize the magics globally
3059 for a certain use. The values set through this function are
3065 for a certain use. The values set through this function are
3060 picked up by the parse_options() method, which all magics should
3066 picked up by the parse_options() method, which all magics should
3061 use to parse their options.
3067 use to parse their options.
3062
3068
3063 * IPython/genutils.py (warn): modified the warnings framework to
3069 * IPython/genutils.py (warn): modified the warnings framework to
3064 use the Term I/O class. I'm trying to slowly unify all of
3070 use the Term I/O class. I'm trying to slowly unify all of
3065 IPython's I/O operations to pass through Term.
3071 IPython's I/O operations to pass through Term.
3066
3072
3067 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3073 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3068 the secondary prompt to correctly match the length of the primary
3074 the secondary prompt to correctly match the length of the primary
3069 one for any prompt. Now multi-line code will properly line up
3075 one for any prompt. Now multi-line code will properly line up
3070 even for path dependent prompts, such as the new ones available
3076 even for path dependent prompts, such as the new ones available
3071 via the prompt_specials.
3077 via the prompt_specials.
3072
3078
3073 2004-06-06 Fernando Perez <fperez@colorado.edu>
3079 2004-06-06 Fernando Perez <fperez@colorado.edu>
3074
3080
3075 * IPython/Prompts.py (prompt_specials): Added the ability to have
3081 * IPython/Prompts.py (prompt_specials): Added the ability to have
3076 bash-like special sequences in the prompts, which get
3082 bash-like special sequences in the prompts, which get
3077 automatically expanded. Things like hostname, current working
3083 automatically expanded. Things like hostname, current working
3078 directory and username are implemented already, but it's easy to
3084 directory and username are implemented already, but it's easy to
3079 add more in the future. Thanks to a patch by W.J. van der Laan
3085 add more in the future. Thanks to a patch by W.J. van der Laan
3080 <gnufnork-AT-hetdigitalegat.nl>
3086 <gnufnork-AT-hetdigitalegat.nl>
3081 (prompt_specials): Added color support for prompt strings, so
3087 (prompt_specials): Added color support for prompt strings, so
3082 users can define arbitrary color setups for their prompts.
3088 users can define arbitrary color setups for their prompts.
3083
3089
3084 2004-06-05 Fernando Perez <fperez@colorado.edu>
3090 2004-06-05 Fernando Perez <fperez@colorado.edu>
3085
3091
3086 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3092 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3087 code to load Gary Bishop's readline and configure it
3093 code to load Gary Bishop's readline and configure it
3088 automatically. Thanks to Gary for help on this.
3094 automatically. Thanks to Gary for help on this.
3089
3095
3090 2004-06-01 Fernando Perez <fperez@colorado.edu>
3096 2004-06-01 Fernando Perez <fperez@colorado.edu>
3091
3097
3092 * IPython/Logger.py (Logger.create_log): fix bug for logging
3098 * IPython/Logger.py (Logger.create_log): fix bug for logging
3093 with no filename (previous fix was incomplete).
3099 with no filename (previous fix was incomplete).
3094
3100
3095 2004-05-25 Fernando Perez <fperez@colorado.edu>
3101 2004-05-25 Fernando Perez <fperez@colorado.edu>
3096
3102
3097 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3103 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3098 parens would get passed to the shell.
3104 parens would get passed to the shell.
3099
3105
3100 2004-05-20 Fernando Perez <fperez@colorado.edu>
3106 2004-05-20 Fernando Perez <fperez@colorado.edu>
3101
3107
3102 * IPython/Magic.py (Magic.magic_prun): changed default profile
3108 * IPython/Magic.py (Magic.magic_prun): changed default profile
3103 sort order to 'time' (the more common profiling need).
3109 sort order to 'time' (the more common profiling need).
3104
3110
3105 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3111 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3106 so that source code shown is guaranteed in sync with the file on
3112 so that source code shown is guaranteed in sync with the file on
3107 disk (also changed in psource). Similar fix to the one for
3113 disk (also changed in psource). Similar fix to the one for
3108 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3114 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3109 <yann.ledu-AT-noos.fr>.
3115 <yann.ledu-AT-noos.fr>.
3110
3116
3111 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3117 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3112 with a single option would not be correctly parsed. Closes
3118 with a single option would not be correctly parsed. Closes
3113 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3119 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3114 introduced in 0.6.0 (on 2004-05-06).
3120 introduced in 0.6.0 (on 2004-05-06).
3115
3121
3116 2004-05-13 *** Released version 0.6.0
3122 2004-05-13 *** Released version 0.6.0
3117
3123
3118 2004-05-13 Fernando Perez <fperez@colorado.edu>
3124 2004-05-13 Fernando Perez <fperez@colorado.edu>
3119
3125
3120 * debian/: Added debian/ directory to CVS, so that debian support
3126 * debian/: Added debian/ directory to CVS, so that debian support
3121 is publicly accessible. The debian package is maintained by Jack
3127 is publicly accessible. The debian package is maintained by Jack
3122 Moffit <jack-AT-xiph.org>.
3128 Moffit <jack-AT-xiph.org>.
3123
3129
3124 * Documentation: included the notes about an ipython-based system
3130 * Documentation: included the notes about an ipython-based system
3125 shell (the hypothetical 'pysh') into the new_design.pdf document,
3131 shell (the hypothetical 'pysh') into the new_design.pdf document,
3126 so that these ideas get distributed to users along with the
3132 so that these ideas get distributed to users along with the
3127 official documentation.
3133 official documentation.
3128
3134
3129 2004-05-10 Fernando Perez <fperez@colorado.edu>
3135 2004-05-10 Fernando Perez <fperez@colorado.edu>
3130
3136
3131 * IPython/Logger.py (Logger.create_log): fix recently introduced
3137 * IPython/Logger.py (Logger.create_log): fix recently introduced
3132 bug (misindented line) where logstart would fail when not given an
3138 bug (misindented line) where logstart would fail when not given an
3133 explicit filename.
3139 explicit filename.
3134
3140
3135 2004-05-09 Fernando Perez <fperez@colorado.edu>
3141 2004-05-09 Fernando Perez <fperez@colorado.edu>
3136
3142
3137 * IPython/Magic.py (Magic.parse_options): skip system call when
3143 * IPython/Magic.py (Magic.parse_options): skip system call when
3138 there are no options to look for. Faster, cleaner for the common
3144 there are no options to look for. Faster, cleaner for the common
3139 case.
3145 case.
3140
3146
3141 * Documentation: many updates to the manual: describing Windows
3147 * Documentation: many updates to the manual: describing Windows
3142 support better, Gnuplot updates, credits, misc small stuff. Also
3148 support better, Gnuplot updates, credits, misc small stuff. Also
3143 updated the new_design doc a bit.
3149 updated the new_design doc a bit.
3144
3150
3145 2004-05-06 *** Released version 0.6.0.rc1
3151 2004-05-06 *** Released version 0.6.0.rc1
3146
3152
3147 2004-05-06 Fernando Perez <fperez@colorado.edu>
3153 2004-05-06 Fernando Perez <fperez@colorado.edu>
3148
3154
3149 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3155 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3150 operations to use the vastly more efficient list/''.join() method.
3156 operations to use the vastly more efficient list/''.join() method.
3151 (FormattedTB.text): Fix
3157 (FormattedTB.text): Fix
3152 http://www.scipy.net/roundup/ipython/issue12 - exception source
3158 http://www.scipy.net/roundup/ipython/issue12 - exception source
3153 extract not updated after reload. Thanks to Mike Salib
3159 extract not updated after reload. Thanks to Mike Salib
3154 <msalib-AT-mit.edu> for pinning the source of the problem.
3160 <msalib-AT-mit.edu> for pinning the source of the problem.
3155 Fortunately, the solution works inside ipython and doesn't require
3161 Fortunately, the solution works inside ipython and doesn't require
3156 any changes to python proper.
3162 any changes to python proper.
3157
3163
3158 * IPython/Magic.py (Magic.parse_options): Improved to process the
3164 * IPython/Magic.py (Magic.parse_options): Improved to process the
3159 argument list as a true shell would (by actually using the
3165 argument list as a true shell would (by actually using the
3160 underlying system shell). This way, all @magics automatically get
3166 underlying system shell). This way, all @magics automatically get
3161 shell expansion for variables. Thanks to a comment by Alex
3167 shell expansion for variables. Thanks to a comment by Alex
3162 Schmolck.
3168 Schmolck.
3163
3169
3164 2004-04-04 Fernando Perez <fperez@colorado.edu>
3170 2004-04-04 Fernando Perez <fperez@colorado.edu>
3165
3171
3166 * IPython/iplib.py (InteractiveShell.interact): Added a special
3172 * IPython/iplib.py (InteractiveShell.interact): Added a special
3167 trap for a debugger quit exception, which is basically impossible
3173 trap for a debugger quit exception, which is basically impossible
3168 to handle by normal mechanisms, given what pdb does to the stack.
3174 to handle by normal mechanisms, given what pdb does to the stack.
3169 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3175 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3170
3176
3171 2004-04-03 Fernando Perez <fperez@colorado.edu>
3177 2004-04-03 Fernando Perez <fperez@colorado.edu>
3172
3178
3173 * IPython/genutils.py (Term): Standardized the names of the Term
3179 * IPython/genutils.py (Term): Standardized the names of the Term
3174 class streams to cin/cout/cerr, following C++ naming conventions
3180 class streams to cin/cout/cerr, following C++ naming conventions
3175 (I can't use in/out/err because 'in' is not a valid attribute
3181 (I can't use in/out/err because 'in' is not a valid attribute
3176 name).
3182 name).
3177
3183
3178 * IPython/iplib.py (InteractiveShell.interact): don't increment
3184 * IPython/iplib.py (InteractiveShell.interact): don't increment
3179 the prompt if there's no user input. By Daniel 'Dang' Griffith
3185 the prompt if there's no user input. By Daniel 'Dang' Griffith
3180 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3186 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3181 Francois Pinard.
3187 Francois Pinard.
3182
3188
3183 2004-04-02 Fernando Perez <fperez@colorado.edu>
3189 2004-04-02 Fernando Perez <fperez@colorado.edu>
3184
3190
3185 * IPython/genutils.py (Stream.__init__): Modified to survive at
3191 * IPython/genutils.py (Stream.__init__): Modified to survive at
3186 least importing in contexts where stdin/out/err aren't true file
3192 least importing in contexts where stdin/out/err aren't true file
3187 objects, such as PyCrust (they lack fileno() and mode). However,
3193 objects, such as PyCrust (they lack fileno() and mode). However,
3188 the recovery facilities which rely on these things existing will
3194 the recovery facilities which rely on these things existing will
3189 not work.
3195 not work.
3190
3196
3191 2004-04-01 Fernando Perez <fperez@colorado.edu>
3197 2004-04-01 Fernando Perez <fperez@colorado.edu>
3192
3198
3193 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3199 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3194 use the new getoutputerror() function, so it properly
3200 use the new getoutputerror() function, so it properly
3195 distinguishes stdout/err.
3201 distinguishes stdout/err.
3196
3202
3197 * IPython/genutils.py (getoutputerror): added a function to
3203 * IPython/genutils.py (getoutputerror): added a function to
3198 capture separately the standard output and error of a command.
3204 capture separately the standard output and error of a command.
3199 After a comment from dang on the mailing lists. This code is
3205 After a comment from dang on the mailing lists. This code is
3200 basically a modified version of commands.getstatusoutput(), from
3206 basically a modified version of commands.getstatusoutput(), from
3201 the standard library.
3207 the standard library.
3202
3208
3203 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3209 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3204 '!!' as a special syntax (shorthand) to access @sx.
3210 '!!' as a special syntax (shorthand) to access @sx.
3205
3211
3206 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3212 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3207 command and return its output as a list split on '\n'.
3213 command and return its output as a list split on '\n'.
3208
3214
3209 2004-03-31 Fernando Perez <fperez@colorado.edu>
3215 2004-03-31 Fernando Perez <fperez@colorado.edu>
3210
3216
3211 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3217 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3212 method to dictionaries used as FakeModule instances if they lack
3218 method to dictionaries used as FakeModule instances if they lack
3213 it. At least pydoc in python2.3 breaks for runtime-defined
3219 it. At least pydoc in python2.3 breaks for runtime-defined
3214 functions without this hack. At some point I need to _really_
3220 functions without this hack. At some point I need to _really_
3215 understand what FakeModule is doing, because it's a gross hack.
3221 understand what FakeModule is doing, because it's a gross hack.
3216 But it solves Arnd's problem for now...
3222 But it solves Arnd's problem for now...
3217
3223
3218 2004-02-27 Fernando Perez <fperez@colorado.edu>
3224 2004-02-27 Fernando Perez <fperez@colorado.edu>
3219
3225
3220 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3226 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3221 mode would behave erratically. Also increased the number of
3227 mode would behave erratically. Also increased the number of
3222 possible logs in rotate mod to 999. Thanks to Rod Holland
3228 possible logs in rotate mod to 999. Thanks to Rod Holland
3223 <rhh@StructureLABS.com> for the report and fixes.
3229 <rhh@StructureLABS.com> for the report and fixes.
3224
3230
3225 2004-02-26 Fernando Perez <fperez@colorado.edu>
3231 2004-02-26 Fernando Perez <fperez@colorado.edu>
3226
3232
3227 * IPython/genutils.py (page): Check that the curses module really
3233 * IPython/genutils.py (page): Check that the curses module really
3228 has the initscr attribute before trying to use it. For some
3234 has the initscr attribute before trying to use it. For some
3229 reason, the Solaris curses module is missing this. I think this
3235 reason, the Solaris curses module is missing this. I think this
3230 should be considered a Solaris python bug, but I'm not sure.
3236 should be considered a Solaris python bug, but I'm not sure.
3231
3237
3232 2004-01-17 Fernando Perez <fperez@colorado.edu>
3238 2004-01-17 Fernando Perez <fperez@colorado.edu>
3233
3239
3234 * IPython/genutils.py (Stream.__init__): Changes to try to make
3240 * IPython/genutils.py (Stream.__init__): Changes to try to make
3235 ipython robust against stdin/out/err being closed by the user.
3241 ipython robust against stdin/out/err being closed by the user.
3236 This is 'user error' (and blocks a normal python session, at least
3242 This is 'user error' (and blocks a normal python session, at least
3237 the stdout case). However, Ipython should be able to survive such
3243 the stdout case). However, Ipython should be able to survive such
3238 instances of abuse as gracefully as possible. To simplify the
3244 instances of abuse as gracefully as possible. To simplify the
3239 coding and maintain compatibility with Gary Bishop's Term
3245 coding and maintain compatibility with Gary Bishop's Term
3240 contributions, I've made use of classmethods for this. I think
3246 contributions, I've made use of classmethods for this. I think
3241 this introduces a dependency on python 2.2.
3247 this introduces a dependency on python 2.2.
3242
3248
3243 2004-01-13 Fernando Perez <fperez@colorado.edu>
3249 2004-01-13 Fernando Perez <fperez@colorado.edu>
3244
3250
3245 * IPython/numutils.py (exp_safe): simplified the code a bit and
3251 * IPython/numutils.py (exp_safe): simplified the code a bit and
3246 removed the need for importing the kinds module altogether.
3252 removed the need for importing the kinds module altogether.
3247
3253
3248 2004-01-06 Fernando Perez <fperez@colorado.edu>
3254 2004-01-06 Fernando Perez <fperez@colorado.edu>
3249
3255
3250 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3256 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3251 a magic function instead, after some community feedback. No
3257 a magic function instead, after some community feedback. No
3252 special syntax will exist for it, but its name is deliberately
3258 special syntax will exist for it, but its name is deliberately
3253 very short.
3259 very short.
3254
3260
3255 2003-12-20 Fernando Perez <fperez@colorado.edu>
3261 2003-12-20 Fernando Perez <fperez@colorado.edu>
3256
3262
3257 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3263 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3258 new functionality, to automagically assign the result of a shell
3264 new functionality, to automagically assign the result of a shell
3259 command to a variable. I'll solicit some community feedback on
3265 command to a variable. I'll solicit some community feedback on
3260 this before making it permanent.
3266 this before making it permanent.
3261
3267
3262 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3268 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3263 requested about callables for which inspect couldn't obtain a
3269 requested about callables for which inspect couldn't obtain a
3264 proper argspec. Thanks to a crash report sent by Etienne
3270 proper argspec. Thanks to a crash report sent by Etienne
3265 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3271 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3266
3272
3267 2003-12-09 Fernando Perez <fperez@colorado.edu>
3273 2003-12-09 Fernando Perez <fperez@colorado.edu>
3268
3274
3269 * IPython/genutils.py (page): patch for the pager to work across
3275 * IPython/genutils.py (page): patch for the pager to work across
3270 various versions of Windows. By Gary Bishop.
3276 various versions of Windows. By Gary Bishop.
3271
3277
3272 2003-12-04 Fernando Perez <fperez@colorado.edu>
3278 2003-12-04 Fernando Perez <fperez@colorado.edu>
3273
3279
3274 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3280 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3275 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3281 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3276 While I tested this and it looks ok, there may still be corner
3282 While I tested this and it looks ok, there may still be corner
3277 cases I've missed.
3283 cases I've missed.
3278
3284
3279 2003-12-01 Fernando Perez <fperez@colorado.edu>
3285 2003-12-01 Fernando Perez <fperez@colorado.edu>
3280
3286
3281 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3287 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3282 where a line like 'p,q=1,2' would fail because the automagic
3288 where a line like 'p,q=1,2' would fail because the automagic
3283 system would be triggered for @p.
3289 system would be triggered for @p.
3284
3290
3285 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3291 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3286 cleanups, code unmodified.
3292 cleanups, code unmodified.
3287
3293
3288 * IPython/genutils.py (Term): added a class for IPython to handle
3294 * IPython/genutils.py (Term): added a class for IPython to handle
3289 output. In most cases it will just be a proxy for stdout/err, but
3295 output. In most cases it will just be a proxy for stdout/err, but
3290 having this allows modifications to be made for some platforms,
3296 having this allows modifications to be made for some platforms,
3291 such as handling color escapes under Windows. All of this code
3297 such as handling color escapes under Windows. All of this code
3292 was contributed by Gary Bishop, with minor modifications by me.
3298 was contributed by Gary Bishop, with minor modifications by me.
3293 The actual changes affect many files.
3299 The actual changes affect many files.
3294
3300
3295 2003-11-30 Fernando Perez <fperez@colorado.edu>
3301 2003-11-30 Fernando Perez <fperez@colorado.edu>
3296
3302
3297 * IPython/iplib.py (file_matches): new completion code, courtesy
3303 * IPython/iplib.py (file_matches): new completion code, courtesy
3298 of Jeff Collins. This enables filename completion again under
3304 of Jeff Collins. This enables filename completion again under
3299 python 2.3, which disabled it at the C level.
3305 python 2.3, which disabled it at the C level.
3300
3306
3301 2003-11-11 Fernando Perez <fperez@colorado.edu>
3307 2003-11-11 Fernando Perez <fperez@colorado.edu>
3302
3308
3303 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3309 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3304 for Numeric.array(map(...)), but often convenient.
3310 for Numeric.array(map(...)), but often convenient.
3305
3311
3306 2003-11-05 Fernando Perez <fperez@colorado.edu>
3312 2003-11-05 Fernando Perez <fperez@colorado.edu>
3307
3313
3308 * IPython/numutils.py (frange): Changed a call from int() to
3314 * IPython/numutils.py (frange): Changed a call from int() to
3309 int(round()) to prevent a problem reported with arange() in the
3315 int(round()) to prevent a problem reported with arange() in the
3310 numpy list.
3316 numpy list.
3311
3317
3312 2003-10-06 Fernando Perez <fperez@colorado.edu>
3318 2003-10-06 Fernando Perez <fperez@colorado.edu>
3313
3319
3314 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3320 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3315 prevent crashes if sys lacks an argv attribute (it happens with
3321 prevent crashes if sys lacks an argv attribute (it happens with
3316 embedded interpreters which build a bare-bones sys module).
3322 embedded interpreters which build a bare-bones sys module).
3317 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3323 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3318
3324
3319 2003-09-24 Fernando Perez <fperez@colorado.edu>
3325 2003-09-24 Fernando Perez <fperez@colorado.edu>
3320
3326
3321 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3327 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3322 to protect against poorly written user objects where __getattr__
3328 to protect against poorly written user objects where __getattr__
3323 raises exceptions other than AttributeError. Thanks to a bug
3329 raises exceptions other than AttributeError. Thanks to a bug
3324 report by Oliver Sander <osander-AT-gmx.de>.
3330 report by Oliver Sander <osander-AT-gmx.de>.
3325
3331
3326 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3332 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3327 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3333 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3328
3334
3329 2003-09-09 Fernando Perez <fperez@colorado.edu>
3335 2003-09-09 Fernando Perez <fperez@colorado.edu>
3330
3336
3331 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3337 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3332 unpacking a list whith a callable as first element would
3338 unpacking a list whith a callable as first element would
3333 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3339 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3334 Collins.
3340 Collins.
3335
3341
3336 2003-08-25 *** Released version 0.5.0
3342 2003-08-25 *** Released version 0.5.0
3337
3343
3338 2003-08-22 Fernando Perez <fperez@colorado.edu>
3344 2003-08-22 Fernando Perez <fperez@colorado.edu>
3339
3345
3340 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3346 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3341 improperly defined user exceptions. Thanks to feedback from Mark
3347 improperly defined user exceptions. Thanks to feedback from Mark
3342 Russell <mrussell-AT-verio.net>.
3348 Russell <mrussell-AT-verio.net>.
3343
3349
3344 2003-08-20 Fernando Perez <fperez@colorado.edu>
3350 2003-08-20 Fernando Perez <fperez@colorado.edu>
3345
3351
3346 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3352 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3347 printing so that it would print multi-line string forms starting
3353 printing so that it would print multi-line string forms starting
3348 with a new line. This way the formatting is better respected for
3354 with a new line. This way the formatting is better respected for
3349 objects which work hard to make nice string forms.
3355 objects which work hard to make nice string forms.
3350
3356
3351 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3357 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3352 autocall would overtake data access for objects with both
3358 autocall would overtake data access for objects with both
3353 __getitem__ and __call__.
3359 __getitem__ and __call__.
3354
3360
3355 2003-08-19 *** Released version 0.5.0-rc1
3361 2003-08-19 *** Released version 0.5.0-rc1
3356
3362
3357 2003-08-19 Fernando Perez <fperez@colorado.edu>
3363 2003-08-19 Fernando Perez <fperez@colorado.edu>
3358
3364
3359 * IPython/deep_reload.py (load_tail): single tiny change here
3365 * IPython/deep_reload.py (load_tail): single tiny change here
3360 seems to fix the long-standing bug of dreload() failing to work
3366 seems to fix the long-standing bug of dreload() failing to work
3361 for dotted names. But this module is pretty tricky, so I may have
3367 for dotted names. But this module is pretty tricky, so I may have
3362 missed some subtlety. Needs more testing!.
3368 missed some subtlety. Needs more testing!.
3363
3369
3364 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3370 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3365 exceptions which have badly implemented __str__ methods.
3371 exceptions which have badly implemented __str__ methods.
3366 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3372 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3367 which I've been getting reports about from Python 2.3 users. I
3373 which I've been getting reports about from Python 2.3 users. I
3368 wish I had a simple test case to reproduce the problem, so I could
3374 wish I had a simple test case to reproduce the problem, so I could
3369 either write a cleaner workaround or file a bug report if
3375 either write a cleaner workaround or file a bug report if
3370 necessary.
3376 necessary.
3371
3377
3372 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3378 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3373 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3379 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3374 a bug report by Tjabo Kloppenburg.
3380 a bug report by Tjabo Kloppenburg.
3375
3381
3376 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3382 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3377 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3383 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3378 seems rather unstable. Thanks to a bug report by Tjabo
3384 seems rather unstable. Thanks to a bug report by Tjabo
3379 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3385 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3380
3386
3381 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3387 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3382 this out soon because of the critical fixes in the inner loop for
3388 this out soon because of the critical fixes in the inner loop for
3383 generators.
3389 generators.
3384
3390
3385 * IPython/Magic.py (Magic.getargspec): removed. This (and
3391 * IPython/Magic.py (Magic.getargspec): removed. This (and
3386 _get_def) have been obsoleted by OInspect for a long time, I
3392 _get_def) have been obsoleted by OInspect for a long time, I
3387 hadn't noticed that they were dead code.
3393 hadn't noticed that they were dead code.
3388 (Magic._ofind): restored _ofind functionality for a few literals
3394 (Magic._ofind): restored _ofind functionality for a few literals
3389 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3395 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3390 for things like "hello".capitalize?, since that would require a
3396 for things like "hello".capitalize?, since that would require a
3391 potentially dangerous eval() again.
3397 potentially dangerous eval() again.
3392
3398
3393 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3399 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3394 logic a bit more to clean up the escapes handling and minimize the
3400 logic a bit more to clean up the escapes handling and minimize the
3395 use of _ofind to only necessary cases. The interactive 'feel' of
3401 use of _ofind to only necessary cases. The interactive 'feel' of
3396 IPython should have improved quite a bit with the changes in
3402 IPython should have improved quite a bit with the changes in
3397 _prefilter and _ofind (besides being far safer than before).
3403 _prefilter and _ofind (besides being far safer than before).
3398
3404
3399 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3405 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3400 obscure, never reported). Edit would fail to find the object to
3406 obscure, never reported). Edit would fail to find the object to
3401 edit under some circumstances.
3407 edit under some circumstances.
3402 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3408 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3403 which were causing double-calling of generators. Those eval calls
3409 which were causing double-calling of generators. Those eval calls
3404 were _very_ dangerous, since code with side effects could be
3410 were _very_ dangerous, since code with side effects could be
3405 triggered. As they say, 'eval is evil'... These were the
3411 triggered. As they say, 'eval is evil'... These were the
3406 nastiest evals in IPython. Besides, _ofind is now far simpler,
3412 nastiest evals in IPython. Besides, _ofind is now far simpler,
3407 and it should also be quite a bit faster. Its use of inspect is
3413 and it should also be quite a bit faster. Its use of inspect is
3408 also safer, so perhaps some of the inspect-related crashes I've
3414 also safer, so perhaps some of the inspect-related crashes I've
3409 seen lately with Python 2.3 might be taken care of. That will
3415 seen lately with Python 2.3 might be taken care of. That will
3410 need more testing.
3416 need more testing.
3411
3417
3412 2003-08-17 Fernando Perez <fperez@colorado.edu>
3418 2003-08-17 Fernando Perez <fperez@colorado.edu>
3413
3419
3414 * IPython/iplib.py (InteractiveShell._prefilter): significant
3420 * IPython/iplib.py (InteractiveShell._prefilter): significant
3415 simplifications to the logic for handling user escapes. Faster
3421 simplifications to the logic for handling user escapes. Faster
3416 and simpler code.
3422 and simpler code.
3417
3423
3418 2003-08-14 Fernando Perez <fperez@colorado.edu>
3424 2003-08-14 Fernando Perez <fperez@colorado.edu>
3419
3425
3420 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3426 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3421 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3427 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3422 but it should be quite a bit faster. And the recursive version
3428 but it should be quite a bit faster. And the recursive version
3423 generated O(log N) intermediate storage for all rank>1 arrays,
3429 generated O(log N) intermediate storage for all rank>1 arrays,
3424 even if they were contiguous.
3430 even if they were contiguous.
3425 (l1norm): Added this function.
3431 (l1norm): Added this function.
3426 (norm): Added this function for arbitrary norms (including
3432 (norm): Added this function for arbitrary norms (including
3427 l-infinity). l1 and l2 are still special cases for convenience
3433 l-infinity). l1 and l2 are still special cases for convenience
3428 and speed.
3434 and speed.
3429
3435
3430 2003-08-03 Fernando Perez <fperez@colorado.edu>
3436 2003-08-03 Fernando Perez <fperez@colorado.edu>
3431
3437
3432 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3438 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3433 exceptions, which now raise PendingDeprecationWarnings in Python
3439 exceptions, which now raise PendingDeprecationWarnings in Python
3434 2.3. There were some in Magic and some in Gnuplot2.
3440 2.3. There were some in Magic and some in Gnuplot2.
3435
3441
3436 2003-06-30 Fernando Perez <fperez@colorado.edu>
3442 2003-06-30 Fernando Perez <fperez@colorado.edu>
3437
3443
3438 * IPython/genutils.py (page): modified to call curses only for
3444 * IPython/genutils.py (page): modified to call curses only for
3439 terminals where TERM=='xterm'. After problems under many other
3445 terminals where TERM=='xterm'. After problems under many other
3440 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3446 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3441
3447
3442 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3448 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3443 would be triggered when readline was absent. This was just an old
3449 would be triggered when readline was absent. This was just an old
3444 debugging statement I'd forgotten to take out.
3450 debugging statement I'd forgotten to take out.
3445
3451
3446 2003-06-20 Fernando Perez <fperez@colorado.edu>
3452 2003-06-20 Fernando Perez <fperez@colorado.edu>
3447
3453
3448 * IPython/genutils.py (clock): modified to return only user time
3454 * IPython/genutils.py (clock): modified to return only user time
3449 (not counting system time), after a discussion on scipy. While
3455 (not counting system time), after a discussion on scipy. While
3450 system time may be a useful quantity occasionally, it may much
3456 system time may be a useful quantity occasionally, it may much
3451 more easily be skewed by occasional swapping or other similar
3457 more easily be skewed by occasional swapping or other similar
3452 activity.
3458 activity.
3453
3459
3454 2003-06-05 Fernando Perez <fperez@colorado.edu>
3460 2003-06-05 Fernando Perez <fperez@colorado.edu>
3455
3461
3456 * IPython/numutils.py (identity): new function, for building
3462 * IPython/numutils.py (identity): new function, for building
3457 arbitrary rank Kronecker deltas (mostly backwards compatible with
3463 arbitrary rank Kronecker deltas (mostly backwards compatible with
3458 Numeric.identity)
3464 Numeric.identity)
3459
3465
3460 2003-06-03 Fernando Perez <fperez@colorado.edu>
3466 2003-06-03 Fernando Perez <fperez@colorado.edu>
3461
3467
3462 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3468 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3463 arguments passed to magics with spaces, to allow trailing '\' to
3469 arguments passed to magics with spaces, to allow trailing '\' to
3464 work normally (mainly for Windows users).
3470 work normally (mainly for Windows users).
3465
3471
3466 2003-05-29 Fernando Perez <fperez@colorado.edu>
3472 2003-05-29 Fernando Perez <fperez@colorado.edu>
3467
3473
3468 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3474 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3469 instead of pydoc.help. This fixes a bizarre behavior where
3475 instead of pydoc.help. This fixes a bizarre behavior where
3470 printing '%s' % locals() would trigger the help system. Now
3476 printing '%s' % locals() would trigger the help system. Now
3471 ipython behaves like normal python does.
3477 ipython behaves like normal python does.
3472
3478
3473 Note that if one does 'from pydoc import help', the bizarre
3479 Note that if one does 'from pydoc import help', the bizarre
3474 behavior returns, but this will also happen in normal python, so
3480 behavior returns, but this will also happen in normal python, so
3475 it's not an ipython bug anymore (it has to do with how pydoc.help
3481 it's not an ipython bug anymore (it has to do with how pydoc.help
3476 is implemented).
3482 is implemented).
3477
3483
3478 2003-05-22 Fernando Perez <fperez@colorado.edu>
3484 2003-05-22 Fernando Perez <fperez@colorado.edu>
3479
3485
3480 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3486 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3481 return [] instead of None when nothing matches, also match to end
3487 return [] instead of None when nothing matches, also match to end
3482 of line. Patch by Gary Bishop.
3488 of line. Patch by Gary Bishop.
3483
3489
3484 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3490 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3485 protection as before, for files passed on the command line. This
3491 protection as before, for files passed on the command line. This
3486 prevents the CrashHandler from kicking in if user files call into
3492 prevents the CrashHandler from kicking in if user files call into
3487 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3493 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3488 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3494 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3489
3495
3490 2003-05-20 *** Released version 0.4.0
3496 2003-05-20 *** Released version 0.4.0
3491
3497
3492 2003-05-20 Fernando Perez <fperez@colorado.edu>
3498 2003-05-20 Fernando Perez <fperez@colorado.edu>
3493
3499
3494 * setup.py: added support for manpages. It's a bit hackish b/c of
3500 * setup.py: added support for manpages. It's a bit hackish b/c of
3495 a bug in the way the bdist_rpm distutils target handles gzipped
3501 a bug in the way the bdist_rpm distutils target handles gzipped
3496 manpages, but it works. After a patch by Jack.
3502 manpages, but it works. After a patch by Jack.
3497
3503
3498 2003-05-19 Fernando Perez <fperez@colorado.edu>
3504 2003-05-19 Fernando Perez <fperez@colorado.edu>
3499
3505
3500 * IPython/numutils.py: added a mockup of the kinds module, since
3506 * IPython/numutils.py: added a mockup of the kinds module, since
3501 it was recently removed from Numeric. This way, numutils will
3507 it was recently removed from Numeric. This way, numutils will
3502 work for all users even if they are missing kinds.
3508 work for all users even if they are missing kinds.
3503
3509
3504 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3510 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3505 failure, which can occur with SWIG-wrapped extensions. After a
3511 failure, which can occur with SWIG-wrapped extensions. After a
3506 crash report from Prabhu.
3512 crash report from Prabhu.
3507
3513
3508 2003-05-16 Fernando Perez <fperez@colorado.edu>
3514 2003-05-16 Fernando Perez <fperez@colorado.edu>
3509
3515
3510 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3516 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3511 protect ipython from user code which may call directly
3517 protect ipython from user code which may call directly
3512 sys.excepthook (this looks like an ipython crash to the user, even
3518 sys.excepthook (this looks like an ipython crash to the user, even
3513 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3519 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3514 This is especially important to help users of WxWindows, but may
3520 This is especially important to help users of WxWindows, but may
3515 also be useful in other cases.
3521 also be useful in other cases.
3516
3522
3517 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3523 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3518 an optional tb_offset to be specified, and to preserve exception
3524 an optional tb_offset to be specified, and to preserve exception
3519 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3525 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3520
3526
3521 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3527 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3522
3528
3523 2003-05-15 Fernando Perez <fperez@colorado.edu>
3529 2003-05-15 Fernando Perez <fperez@colorado.edu>
3524
3530
3525 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3531 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3526 installing for a new user under Windows.
3532 installing for a new user under Windows.
3527
3533
3528 2003-05-12 Fernando Perez <fperez@colorado.edu>
3534 2003-05-12 Fernando Perez <fperez@colorado.edu>
3529
3535
3530 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3536 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3531 handler for Emacs comint-based lines. Currently it doesn't do
3537 handler for Emacs comint-based lines. Currently it doesn't do
3532 much (but importantly, it doesn't update the history cache). In
3538 much (but importantly, it doesn't update the history cache). In
3533 the future it may be expanded if Alex needs more functionality
3539 the future it may be expanded if Alex needs more functionality
3534 there.
3540 there.
3535
3541
3536 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3542 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3537 info to crash reports.
3543 info to crash reports.
3538
3544
3539 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3545 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3540 just like Python's -c. Also fixed crash with invalid -color
3546 just like Python's -c. Also fixed crash with invalid -color
3541 option value at startup. Thanks to Will French
3547 option value at startup. Thanks to Will French
3542 <wfrench-AT-bestweb.net> for the bug report.
3548 <wfrench-AT-bestweb.net> for the bug report.
3543
3549
3544 2003-05-09 Fernando Perez <fperez@colorado.edu>
3550 2003-05-09 Fernando Perez <fperez@colorado.edu>
3545
3551
3546 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3552 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3547 to EvalDict (it's a mapping, after all) and simplified its code
3553 to EvalDict (it's a mapping, after all) and simplified its code
3548 quite a bit, after a nice discussion on c.l.py where Gustavo
3554 quite a bit, after a nice discussion on c.l.py where Gustavo
3549 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3555 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3550
3556
3551 2003-04-30 Fernando Perez <fperez@colorado.edu>
3557 2003-04-30 Fernando Perez <fperez@colorado.edu>
3552
3558
3553 * IPython/genutils.py (timings_out): modified it to reduce its
3559 * IPython/genutils.py (timings_out): modified it to reduce its
3554 overhead in the common reps==1 case.
3560 overhead in the common reps==1 case.
3555
3561
3556 2003-04-29 Fernando Perez <fperez@colorado.edu>
3562 2003-04-29 Fernando Perez <fperez@colorado.edu>
3557
3563
3558 * IPython/genutils.py (timings_out): Modified to use the resource
3564 * IPython/genutils.py (timings_out): Modified to use the resource
3559 module, which avoids the wraparound problems of time.clock().
3565 module, which avoids the wraparound problems of time.clock().
3560
3566
3561 2003-04-17 *** Released version 0.2.15pre4
3567 2003-04-17 *** Released version 0.2.15pre4
3562
3568
3563 2003-04-17 Fernando Perez <fperez@colorado.edu>
3569 2003-04-17 Fernando Perez <fperez@colorado.edu>
3564
3570
3565 * setup.py (scriptfiles): Split windows-specific stuff over to a
3571 * setup.py (scriptfiles): Split windows-specific stuff over to a
3566 separate file, in an attempt to have a Windows GUI installer.
3572 separate file, in an attempt to have a Windows GUI installer.
3567 That didn't work, but part of the groundwork is done.
3573 That didn't work, but part of the groundwork is done.
3568
3574
3569 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3575 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3570 indent/unindent with 4 spaces. Particularly useful in combination
3576 indent/unindent with 4 spaces. Particularly useful in combination
3571 with the new auto-indent option.
3577 with the new auto-indent option.
3572
3578
3573 2003-04-16 Fernando Perez <fperez@colorado.edu>
3579 2003-04-16 Fernando Perez <fperez@colorado.edu>
3574
3580
3575 * IPython/Magic.py: various replacements of self.rc for
3581 * IPython/Magic.py: various replacements of self.rc for
3576 self.shell.rc. A lot more remains to be done to fully disentangle
3582 self.shell.rc. A lot more remains to be done to fully disentangle
3577 this class from the main Shell class.
3583 this class from the main Shell class.
3578
3584
3579 * IPython/GnuplotRuntime.py: added checks for mouse support so
3585 * IPython/GnuplotRuntime.py: added checks for mouse support so
3580 that we don't try to enable it if the current gnuplot doesn't
3586 that we don't try to enable it if the current gnuplot doesn't
3581 really support it. Also added checks so that we don't try to
3587 really support it. Also added checks so that we don't try to
3582 enable persist under Windows (where Gnuplot doesn't recognize the
3588 enable persist under Windows (where Gnuplot doesn't recognize the
3583 option).
3589 option).
3584
3590
3585 * IPython/iplib.py (InteractiveShell.interact): Added optional
3591 * IPython/iplib.py (InteractiveShell.interact): Added optional
3586 auto-indenting code, after a patch by King C. Shu
3592 auto-indenting code, after a patch by King C. Shu
3587 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3593 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3588 get along well with pasting indented code. If I ever figure out
3594 get along well with pasting indented code. If I ever figure out
3589 how to make that part go well, it will become on by default.
3595 how to make that part go well, it will become on by default.
3590
3596
3591 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3597 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3592 crash ipython if there was an unmatched '%' in the user's prompt
3598 crash ipython if there was an unmatched '%' in the user's prompt
3593 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3599 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3594
3600
3595 * IPython/iplib.py (InteractiveShell.interact): removed the
3601 * IPython/iplib.py (InteractiveShell.interact): removed the
3596 ability to ask the user whether he wants to crash or not at the
3602 ability to ask the user whether he wants to crash or not at the
3597 'last line' exception handler. Calling functions at that point
3603 'last line' exception handler. Calling functions at that point
3598 changes the stack, and the error reports would have incorrect
3604 changes the stack, and the error reports would have incorrect
3599 tracebacks.
3605 tracebacks.
3600
3606
3601 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3607 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3602 pass through a peger a pretty-printed form of any object. After a
3608 pass through a peger a pretty-printed form of any object. After a
3603 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3609 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3604
3610
3605 2003-04-14 Fernando Perez <fperez@colorado.edu>
3611 2003-04-14 Fernando Perez <fperez@colorado.edu>
3606
3612
3607 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3613 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3608 all files in ~ would be modified at first install (instead of
3614 all files in ~ would be modified at first install (instead of
3609 ~/.ipython). This could be potentially disastrous, as the
3615 ~/.ipython). This could be potentially disastrous, as the
3610 modification (make line-endings native) could damage binary files.
3616 modification (make line-endings native) could damage binary files.
3611
3617
3612 2003-04-10 Fernando Perez <fperez@colorado.edu>
3618 2003-04-10 Fernando Perez <fperez@colorado.edu>
3613
3619
3614 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3620 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3615 handle only lines which are invalid python. This now means that
3621 handle only lines which are invalid python. This now means that
3616 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3622 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3617 for the bug report.
3623 for the bug report.
3618
3624
3619 2003-04-01 Fernando Perez <fperez@colorado.edu>
3625 2003-04-01 Fernando Perez <fperez@colorado.edu>
3620
3626
3621 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3627 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3622 where failing to set sys.last_traceback would crash pdb.pm().
3628 where failing to set sys.last_traceback would crash pdb.pm().
3623 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3629 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3624 report.
3630 report.
3625
3631
3626 2003-03-25 Fernando Perez <fperez@colorado.edu>
3632 2003-03-25 Fernando Perez <fperez@colorado.edu>
3627
3633
3628 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3634 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3629 before printing it (it had a lot of spurious blank lines at the
3635 before printing it (it had a lot of spurious blank lines at the
3630 end).
3636 end).
3631
3637
3632 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3638 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3633 output would be sent 21 times! Obviously people don't use this
3639 output would be sent 21 times! Obviously people don't use this
3634 too often, or I would have heard about it.
3640 too often, or I would have heard about it.
3635
3641
3636 2003-03-24 Fernando Perez <fperez@colorado.edu>
3642 2003-03-24 Fernando Perez <fperez@colorado.edu>
3637
3643
3638 * setup.py (scriptfiles): renamed the data_files parameter from
3644 * setup.py (scriptfiles): renamed the data_files parameter from
3639 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3645 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3640 for the patch.
3646 for the patch.
3641
3647
3642 2003-03-20 Fernando Perez <fperez@colorado.edu>
3648 2003-03-20 Fernando Perez <fperez@colorado.edu>
3643
3649
3644 * IPython/genutils.py (error): added error() and fatal()
3650 * IPython/genutils.py (error): added error() and fatal()
3645 functions.
3651 functions.
3646
3652
3647 2003-03-18 *** Released version 0.2.15pre3
3653 2003-03-18 *** Released version 0.2.15pre3
3648
3654
3649 2003-03-18 Fernando Perez <fperez@colorado.edu>
3655 2003-03-18 Fernando Perez <fperez@colorado.edu>
3650
3656
3651 * setupext/install_data_ext.py
3657 * setupext/install_data_ext.py
3652 (install_data_ext.initialize_options): Class contributed by Jack
3658 (install_data_ext.initialize_options): Class contributed by Jack
3653 Moffit for fixing the old distutils hack. He is sending this to
3659 Moffit for fixing the old distutils hack. He is sending this to
3654 the distutils folks so in the future we may not need it as a
3660 the distutils folks so in the future we may not need it as a
3655 private fix.
3661 private fix.
3656
3662
3657 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3663 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3658 changes for Debian packaging. See his patch for full details.
3664 changes for Debian packaging. See his patch for full details.
3659 The old distutils hack of making the ipythonrc* files carry a
3665 The old distutils hack of making the ipythonrc* files carry a
3660 bogus .py extension is gone, at last. Examples were moved to a
3666 bogus .py extension is gone, at last. Examples were moved to a
3661 separate subdir under doc/, and the separate executable scripts
3667 separate subdir under doc/, and the separate executable scripts
3662 now live in their own directory. Overall a great cleanup. The
3668 now live in their own directory. Overall a great cleanup. The
3663 manual was updated to use the new files, and setup.py has been
3669 manual was updated to use the new files, and setup.py has been
3664 fixed for this setup.
3670 fixed for this setup.
3665
3671
3666 * IPython/PyColorize.py (Parser.usage): made non-executable and
3672 * IPython/PyColorize.py (Parser.usage): made non-executable and
3667 created a pycolor wrapper around it to be included as a script.
3673 created a pycolor wrapper around it to be included as a script.
3668
3674
3669 2003-03-12 *** Released version 0.2.15pre2
3675 2003-03-12 *** Released version 0.2.15pre2
3670
3676
3671 2003-03-12 Fernando Perez <fperez@colorado.edu>
3677 2003-03-12 Fernando Perez <fperez@colorado.edu>
3672
3678
3673 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3679 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3674 long-standing problem with garbage characters in some terminals.
3680 long-standing problem with garbage characters in some terminals.
3675 The issue was really that the \001 and \002 escapes must _only_ be
3681 The issue was really that the \001 and \002 escapes must _only_ be
3676 passed to input prompts (which call readline), but _never_ to
3682 passed to input prompts (which call readline), but _never_ to
3677 normal text to be printed on screen. I changed ColorANSI to have
3683 normal text to be printed on screen. I changed ColorANSI to have
3678 two classes: TermColors and InputTermColors, each with the
3684 two classes: TermColors and InputTermColors, each with the
3679 appropriate escapes for input prompts or normal text. The code in
3685 appropriate escapes for input prompts or normal text. The code in
3680 Prompts.py got slightly more complicated, but this very old and
3686 Prompts.py got slightly more complicated, but this very old and
3681 annoying bug is finally fixed.
3687 annoying bug is finally fixed.
3682
3688
3683 All the credit for nailing down the real origin of this problem
3689 All the credit for nailing down the real origin of this problem
3684 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3690 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3685 *Many* thanks to him for spending quite a bit of effort on this.
3691 *Many* thanks to him for spending quite a bit of effort on this.
3686
3692
3687 2003-03-05 *** Released version 0.2.15pre1
3693 2003-03-05 *** Released version 0.2.15pre1
3688
3694
3689 2003-03-03 Fernando Perez <fperez@colorado.edu>
3695 2003-03-03 Fernando Perez <fperez@colorado.edu>
3690
3696
3691 * IPython/FakeModule.py: Moved the former _FakeModule to a
3697 * IPython/FakeModule.py: Moved the former _FakeModule to a
3692 separate file, because it's also needed by Magic (to fix a similar
3698 separate file, because it's also needed by Magic (to fix a similar
3693 pickle-related issue in @run).
3699 pickle-related issue in @run).
3694
3700
3695 2003-03-02 Fernando Perez <fperez@colorado.edu>
3701 2003-03-02 Fernando Perez <fperez@colorado.edu>
3696
3702
3697 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3703 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3698 the autocall option at runtime.
3704 the autocall option at runtime.
3699 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3705 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3700 across Magic.py to start separating Magic from InteractiveShell.
3706 across Magic.py to start separating Magic from InteractiveShell.
3701 (Magic._ofind): Fixed to return proper namespace for dotted
3707 (Magic._ofind): Fixed to return proper namespace for dotted
3702 names. Before, a dotted name would always return 'not currently
3708 names. Before, a dotted name would always return 'not currently
3703 defined', because it would find the 'parent'. s.x would be found,
3709 defined', because it would find the 'parent'. s.x would be found,
3704 but since 'x' isn't defined by itself, it would get confused.
3710 but since 'x' isn't defined by itself, it would get confused.
3705 (Magic.magic_run): Fixed pickling problems reported by Ralf
3711 (Magic.magic_run): Fixed pickling problems reported by Ralf
3706 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3712 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3707 that I'd used when Mike Heeter reported similar issues at the
3713 that I'd used when Mike Heeter reported similar issues at the
3708 top-level, but now for @run. It boils down to injecting the
3714 top-level, but now for @run. It boils down to injecting the
3709 namespace where code is being executed with something that looks
3715 namespace where code is being executed with something that looks
3710 enough like a module to fool pickle.dump(). Since a pickle stores
3716 enough like a module to fool pickle.dump(). Since a pickle stores
3711 a named reference to the importing module, we need this for
3717 a named reference to the importing module, we need this for
3712 pickles to save something sensible.
3718 pickles to save something sensible.
3713
3719
3714 * IPython/ipmaker.py (make_IPython): added an autocall option.
3720 * IPython/ipmaker.py (make_IPython): added an autocall option.
3715
3721
3716 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3722 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3717 the auto-eval code. Now autocalling is an option, and the code is
3723 the auto-eval code. Now autocalling is an option, and the code is
3718 also vastly safer. There is no more eval() involved at all.
3724 also vastly safer. There is no more eval() involved at all.
3719
3725
3720 2003-03-01 Fernando Perez <fperez@colorado.edu>
3726 2003-03-01 Fernando Perez <fperez@colorado.edu>
3721
3727
3722 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3728 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3723 dict with named keys instead of a tuple.
3729 dict with named keys instead of a tuple.
3724
3730
3725 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3731 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3726
3732
3727 * setup.py (make_shortcut): Fixed message about directories
3733 * setup.py (make_shortcut): Fixed message about directories
3728 created during Windows installation (the directories were ok, just
3734 created during Windows installation (the directories were ok, just
3729 the printed message was misleading). Thanks to Chris Liechti
3735 the printed message was misleading). Thanks to Chris Liechti
3730 <cliechti-AT-gmx.net> for the heads up.
3736 <cliechti-AT-gmx.net> for the heads up.
3731
3737
3732 2003-02-21 Fernando Perez <fperez@colorado.edu>
3738 2003-02-21 Fernando Perez <fperez@colorado.edu>
3733
3739
3734 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3740 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3735 of ValueError exception when checking for auto-execution. This
3741 of ValueError exception when checking for auto-execution. This
3736 one is raised by things like Numeric arrays arr.flat when the
3742 one is raised by things like Numeric arrays arr.flat when the
3737 array is non-contiguous.
3743 array is non-contiguous.
3738
3744
3739 2003-01-31 Fernando Perez <fperez@colorado.edu>
3745 2003-01-31 Fernando Perez <fperez@colorado.edu>
3740
3746
3741 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3747 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3742 not return any value at all (even though the command would get
3748 not return any value at all (even though the command would get
3743 executed).
3749 executed).
3744 (xsys): Flush stdout right after printing the command to ensure
3750 (xsys): Flush stdout right after printing the command to ensure
3745 proper ordering of commands and command output in the total
3751 proper ordering of commands and command output in the total
3746 output.
3752 output.
3747 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3753 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3748 system/getoutput as defaults. The old ones are kept for
3754 system/getoutput as defaults. The old ones are kept for
3749 compatibility reasons, so no code which uses this library needs
3755 compatibility reasons, so no code which uses this library needs
3750 changing.
3756 changing.
3751
3757
3752 2003-01-27 *** Released version 0.2.14
3758 2003-01-27 *** Released version 0.2.14
3753
3759
3754 2003-01-25 Fernando Perez <fperez@colorado.edu>
3760 2003-01-25 Fernando Perez <fperez@colorado.edu>
3755
3761
3756 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3762 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3757 functions defined in previous edit sessions could not be re-edited
3763 functions defined in previous edit sessions could not be re-edited
3758 (because the temp files were immediately removed). Now temp files
3764 (because the temp files were immediately removed). Now temp files
3759 are removed only at IPython's exit.
3765 are removed only at IPython's exit.
3760 (Magic.magic_run): Improved @run to perform shell-like expansions
3766 (Magic.magic_run): Improved @run to perform shell-like expansions
3761 on its arguments (~users and $VARS). With this, @run becomes more
3767 on its arguments (~users and $VARS). With this, @run becomes more
3762 like a normal command-line.
3768 like a normal command-line.
3763
3769
3764 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3770 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3765 bugs related to embedding and cleaned up that code. A fairly
3771 bugs related to embedding and cleaned up that code. A fairly
3766 important one was the impossibility to access the global namespace
3772 important one was the impossibility to access the global namespace
3767 through the embedded IPython (only local variables were visible).
3773 through the embedded IPython (only local variables were visible).
3768
3774
3769 2003-01-14 Fernando Perez <fperez@colorado.edu>
3775 2003-01-14 Fernando Perez <fperez@colorado.edu>
3770
3776
3771 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3777 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3772 auto-calling to be a bit more conservative. Now it doesn't get
3778 auto-calling to be a bit more conservative. Now it doesn't get
3773 triggered if any of '!=()<>' are in the rest of the input line, to
3779 triggered if any of '!=()<>' are in the rest of the input line, to
3774 allow comparing callables. Thanks to Alex for the heads up.
3780 allow comparing callables. Thanks to Alex for the heads up.
3775
3781
3776 2003-01-07 Fernando Perez <fperez@colorado.edu>
3782 2003-01-07 Fernando Perez <fperez@colorado.edu>
3777
3783
3778 * IPython/genutils.py (page): fixed estimation of the number of
3784 * IPython/genutils.py (page): fixed estimation of the number of
3779 lines in a string to be paged to simply count newlines. This
3785 lines in a string to be paged to simply count newlines. This
3780 prevents over-guessing due to embedded escape sequences. A better
3786 prevents over-guessing due to embedded escape sequences. A better
3781 long-term solution would involve stripping out the control chars
3787 long-term solution would involve stripping out the control chars
3782 for the count, but it's potentially so expensive I just don't
3788 for the count, but it's potentially so expensive I just don't
3783 think it's worth doing.
3789 think it's worth doing.
3784
3790
3785 2002-12-19 *** Released version 0.2.14pre50
3791 2002-12-19 *** Released version 0.2.14pre50
3786
3792
3787 2002-12-19 Fernando Perez <fperez@colorado.edu>
3793 2002-12-19 Fernando Perez <fperez@colorado.edu>
3788
3794
3789 * tools/release (version): Changed release scripts to inform
3795 * tools/release (version): Changed release scripts to inform
3790 Andrea and build a NEWS file with a list of recent changes.
3796 Andrea and build a NEWS file with a list of recent changes.
3791
3797
3792 * IPython/ColorANSI.py (__all__): changed terminal detection
3798 * IPython/ColorANSI.py (__all__): changed terminal detection
3793 code. Seems to work better for xterms without breaking
3799 code. Seems to work better for xterms without breaking
3794 konsole. Will need more testing to determine if WinXP and Mac OSX
3800 konsole. Will need more testing to determine if WinXP and Mac OSX
3795 also work ok.
3801 also work ok.
3796
3802
3797 2002-12-18 *** Released version 0.2.14pre49
3803 2002-12-18 *** Released version 0.2.14pre49
3798
3804
3799 2002-12-18 Fernando Perez <fperez@colorado.edu>
3805 2002-12-18 Fernando Perez <fperez@colorado.edu>
3800
3806
3801 * Docs: added new info about Mac OSX, from Andrea.
3807 * Docs: added new info about Mac OSX, from Andrea.
3802
3808
3803 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3809 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3804 allow direct plotting of python strings whose format is the same
3810 allow direct plotting of python strings whose format is the same
3805 of gnuplot data files.
3811 of gnuplot data files.
3806
3812
3807 2002-12-16 Fernando Perez <fperez@colorado.edu>
3813 2002-12-16 Fernando Perez <fperez@colorado.edu>
3808
3814
3809 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3815 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3810 value of exit question to be acknowledged.
3816 value of exit question to be acknowledged.
3811
3817
3812 2002-12-03 Fernando Perez <fperez@colorado.edu>
3818 2002-12-03 Fernando Perez <fperez@colorado.edu>
3813
3819
3814 * IPython/ipmaker.py: removed generators, which had been added
3820 * IPython/ipmaker.py: removed generators, which had been added
3815 by mistake in an earlier debugging run. This was causing trouble
3821 by mistake in an earlier debugging run. This was causing trouble
3816 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3822 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3817 for pointing this out.
3823 for pointing this out.
3818
3824
3819 2002-11-17 Fernando Perez <fperez@colorado.edu>
3825 2002-11-17 Fernando Perez <fperez@colorado.edu>
3820
3826
3821 * Manual: updated the Gnuplot section.
3827 * Manual: updated the Gnuplot section.
3822
3828
3823 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3829 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3824 a much better split of what goes in Runtime and what goes in
3830 a much better split of what goes in Runtime and what goes in
3825 Interactive.
3831 Interactive.
3826
3832
3827 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3833 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3828 being imported from iplib.
3834 being imported from iplib.
3829
3835
3830 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3836 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3831 for command-passing. Now the global Gnuplot instance is called
3837 for command-passing. Now the global Gnuplot instance is called
3832 'gp' instead of 'g', which was really a far too fragile and
3838 'gp' instead of 'g', which was really a far too fragile and
3833 common name.
3839 common name.
3834
3840
3835 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3841 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3836 bounding boxes generated by Gnuplot for square plots.
3842 bounding boxes generated by Gnuplot for square plots.
3837
3843
3838 * IPython/genutils.py (popkey): new function added. I should
3844 * IPython/genutils.py (popkey): new function added. I should
3839 suggest this on c.l.py as a dict method, it seems useful.
3845 suggest this on c.l.py as a dict method, it seems useful.
3840
3846
3841 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3847 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3842 to transparently handle PostScript generation. MUCH better than
3848 to transparently handle PostScript generation. MUCH better than
3843 the previous plot_eps/replot_eps (which I removed now). The code
3849 the previous plot_eps/replot_eps (which I removed now). The code
3844 is also fairly clean and well documented now (including
3850 is also fairly clean and well documented now (including
3845 docstrings).
3851 docstrings).
3846
3852
3847 2002-11-13 Fernando Perez <fperez@colorado.edu>
3853 2002-11-13 Fernando Perez <fperez@colorado.edu>
3848
3854
3849 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3855 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3850 (inconsistent with options).
3856 (inconsistent with options).
3851
3857
3852 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3858 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3853 manually disabled, I don't know why. Fixed it.
3859 manually disabled, I don't know why. Fixed it.
3854 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3860 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3855 eps output.
3861 eps output.
3856
3862
3857 2002-11-12 Fernando Perez <fperez@colorado.edu>
3863 2002-11-12 Fernando Perez <fperez@colorado.edu>
3858
3864
3859 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3865 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3860 don't propagate up to caller. Fixes crash reported by François
3866 don't propagate up to caller. Fixes crash reported by François
3861 Pinard.
3867 Pinard.
3862
3868
3863 2002-11-09 Fernando Perez <fperez@colorado.edu>
3869 2002-11-09 Fernando Perez <fperez@colorado.edu>
3864
3870
3865 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3871 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3866 history file for new users.
3872 history file for new users.
3867 (make_IPython): fixed bug where initial install would leave the
3873 (make_IPython): fixed bug where initial install would leave the
3868 user running in the .ipython dir.
3874 user running in the .ipython dir.
3869 (make_IPython): fixed bug where config dir .ipython would be
3875 (make_IPython): fixed bug where config dir .ipython would be
3870 created regardless of the given -ipythondir option. Thanks to Cory
3876 created regardless of the given -ipythondir option. Thanks to Cory
3871 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3877 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3872
3878
3873 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3879 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3874 type confirmations. Will need to use it in all of IPython's code
3880 type confirmations. Will need to use it in all of IPython's code
3875 consistently.
3881 consistently.
3876
3882
3877 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3883 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3878 context to print 31 lines instead of the default 5. This will make
3884 context to print 31 lines instead of the default 5. This will make
3879 the crash reports extremely detailed in case the problem is in
3885 the crash reports extremely detailed in case the problem is in
3880 libraries I don't have access to.
3886 libraries I don't have access to.
3881
3887
3882 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3888 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3883 line of defense' code to still crash, but giving users fair
3889 line of defense' code to still crash, but giving users fair
3884 warning. I don't want internal errors to go unreported: if there's
3890 warning. I don't want internal errors to go unreported: if there's
3885 an internal problem, IPython should crash and generate a full
3891 an internal problem, IPython should crash and generate a full
3886 report.
3892 report.
3887
3893
3888 2002-11-08 Fernando Perez <fperez@colorado.edu>
3894 2002-11-08 Fernando Perez <fperez@colorado.edu>
3889
3895
3890 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3896 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3891 otherwise uncaught exceptions which can appear if people set
3897 otherwise uncaught exceptions which can appear if people set
3892 sys.stdout to something badly broken. Thanks to a crash report
3898 sys.stdout to something badly broken. Thanks to a crash report
3893 from henni-AT-mail.brainbot.com.
3899 from henni-AT-mail.brainbot.com.
3894
3900
3895 2002-11-04 Fernando Perez <fperez@colorado.edu>
3901 2002-11-04 Fernando Perez <fperez@colorado.edu>
3896
3902
3897 * IPython/iplib.py (InteractiveShell.interact): added
3903 * IPython/iplib.py (InteractiveShell.interact): added
3898 __IPYTHON__active to the builtins. It's a flag which goes on when
3904 __IPYTHON__active to the builtins. It's a flag which goes on when
3899 the interaction starts and goes off again when it stops. This
3905 the interaction starts and goes off again when it stops. This
3900 allows embedding code to detect being inside IPython. Before this
3906 allows embedding code to detect being inside IPython. Before this
3901 was done via __IPYTHON__, but that only shows that an IPython
3907 was done via __IPYTHON__, but that only shows that an IPython
3902 instance has been created.
3908 instance has been created.
3903
3909
3904 * IPython/Magic.py (Magic.magic_env): I realized that in a
3910 * IPython/Magic.py (Magic.magic_env): I realized that in a
3905 UserDict, instance.data holds the data as a normal dict. So I
3911 UserDict, instance.data holds the data as a normal dict. So I
3906 modified @env to return os.environ.data instead of rebuilding a
3912 modified @env to return os.environ.data instead of rebuilding a
3907 dict by hand.
3913 dict by hand.
3908
3914
3909 2002-11-02 Fernando Perez <fperez@colorado.edu>
3915 2002-11-02 Fernando Perez <fperez@colorado.edu>
3910
3916
3911 * IPython/genutils.py (warn): changed so that level 1 prints no
3917 * IPython/genutils.py (warn): changed so that level 1 prints no
3912 header. Level 2 is now the default (with 'WARNING' header, as
3918 header. Level 2 is now the default (with 'WARNING' header, as
3913 before). I think I tracked all places where changes were needed in
3919 before). I think I tracked all places where changes were needed in
3914 IPython, but outside code using the old level numbering may have
3920 IPython, but outside code using the old level numbering may have
3915 broken.
3921 broken.
3916
3922
3917 * IPython/iplib.py (InteractiveShell.runcode): added this to
3923 * IPython/iplib.py (InteractiveShell.runcode): added this to
3918 handle the tracebacks in SystemExit traps correctly. The previous
3924 handle the tracebacks in SystemExit traps correctly. The previous
3919 code (through interact) was printing more of the stack than
3925 code (through interact) was printing more of the stack than
3920 necessary, showing IPython internal code to the user.
3926 necessary, showing IPython internal code to the user.
3921
3927
3922 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3928 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3923 default. Now that the default at the confirmation prompt is yes,
3929 default. Now that the default at the confirmation prompt is yes,
3924 it's not so intrusive. François' argument that ipython sessions
3930 it's not so intrusive. François' argument that ipython sessions
3925 tend to be complex enough not to lose them from an accidental C-d,
3931 tend to be complex enough not to lose them from an accidental C-d,
3926 is a valid one.
3932 is a valid one.
3927
3933
3928 * IPython/iplib.py (InteractiveShell.interact): added a
3934 * IPython/iplib.py (InteractiveShell.interact): added a
3929 showtraceback() call to the SystemExit trap, and modified the exit
3935 showtraceback() call to the SystemExit trap, and modified the exit
3930 confirmation to have yes as the default.
3936 confirmation to have yes as the default.
3931
3937
3932 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3938 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3933 this file. It's been gone from the code for a long time, this was
3939 this file. It's been gone from the code for a long time, this was
3934 simply leftover junk.
3940 simply leftover junk.
3935
3941
3936 2002-11-01 Fernando Perez <fperez@colorado.edu>
3942 2002-11-01 Fernando Perez <fperez@colorado.edu>
3937
3943
3938 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3944 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3939 added. If set, IPython now traps EOF and asks for
3945 added. If set, IPython now traps EOF and asks for
3940 confirmation. After a request by François Pinard.
3946 confirmation. After a request by François Pinard.
3941
3947
3942 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3948 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3943 of @abort, and with a new (better) mechanism for handling the
3949 of @abort, and with a new (better) mechanism for handling the
3944 exceptions.
3950 exceptions.
3945
3951
3946 2002-10-27 Fernando Perez <fperez@colorado.edu>
3952 2002-10-27 Fernando Perez <fperez@colorado.edu>
3947
3953
3948 * IPython/usage.py (__doc__): updated the --help information and
3954 * IPython/usage.py (__doc__): updated the --help information and
3949 the ipythonrc file to indicate that -log generates
3955 the ipythonrc file to indicate that -log generates
3950 ./ipython.log. Also fixed the corresponding info in @logstart.
3956 ./ipython.log. Also fixed the corresponding info in @logstart.
3951 This and several other fixes in the manuals thanks to reports by
3957 This and several other fixes in the manuals thanks to reports by
3952 François Pinard <pinard-AT-iro.umontreal.ca>.
3958 François Pinard <pinard-AT-iro.umontreal.ca>.
3953
3959
3954 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3960 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3955 refer to @logstart (instead of @log, which doesn't exist).
3961 refer to @logstart (instead of @log, which doesn't exist).
3956
3962
3957 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3963 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3958 AttributeError crash. Thanks to Christopher Armstrong
3964 AttributeError crash. Thanks to Christopher Armstrong
3959 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3965 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3960 introduced recently (in 0.2.14pre37) with the fix to the eval
3966 introduced recently (in 0.2.14pre37) with the fix to the eval
3961 problem mentioned below.
3967 problem mentioned below.
3962
3968
3963 2002-10-17 Fernando Perez <fperez@colorado.edu>
3969 2002-10-17 Fernando Perez <fperez@colorado.edu>
3964
3970
3965 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3971 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3966 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3972 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3967
3973
3968 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3974 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3969 this function to fix a problem reported by Alex Schmolck. He saw
3975 this function to fix a problem reported by Alex Schmolck. He saw
3970 it with list comprehensions and generators, which were getting
3976 it with list comprehensions and generators, which were getting
3971 called twice. The real problem was an 'eval' call in testing for
3977 called twice. The real problem was an 'eval' call in testing for
3972 automagic which was evaluating the input line silently.
3978 automagic which was evaluating the input line silently.
3973
3979
3974 This is a potentially very nasty bug, if the input has side
3980 This is a potentially very nasty bug, if the input has side
3975 effects which must not be repeated. The code is much cleaner now,
3981 effects which must not be repeated. The code is much cleaner now,
3976 without any blanket 'except' left and with a regexp test for
3982 without any blanket 'except' left and with a regexp test for
3977 actual function names.
3983 actual function names.
3978
3984
3979 But an eval remains, which I'm not fully comfortable with. I just
3985 But an eval remains, which I'm not fully comfortable with. I just
3980 don't know how to find out if an expression could be a callable in
3986 don't know how to find out if an expression could be a callable in
3981 the user's namespace without doing an eval on the string. However
3987 the user's namespace without doing an eval on the string. However
3982 that string is now much more strictly checked so that no code
3988 that string is now much more strictly checked so that no code
3983 slips by, so the eval should only happen for things that can
3989 slips by, so the eval should only happen for things that can
3984 really be only function/method names.
3990 really be only function/method names.
3985
3991
3986 2002-10-15 Fernando Perez <fperez@colorado.edu>
3992 2002-10-15 Fernando Perez <fperez@colorado.edu>
3987
3993
3988 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3994 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3989 OSX information to main manual, removed README_Mac_OSX file from
3995 OSX information to main manual, removed README_Mac_OSX file from
3990 distribution. Also updated credits for recent additions.
3996 distribution. Also updated credits for recent additions.
3991
3997
3992 2002-10-10 Fernando Perez <fperez@colorado.edu>
3998 2002-10-10 Fernando Perez <fperez@colorado.edu>
3993
3999
3994 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4000 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3995 terminal-related issues. Many thanks to Andrea Riciputi
4001 terminal-related issues. Many thanks to Andrea Riciputi
3996 <andrea.riciputi-AT-libero.it> for writing it.
4002 <andrea.riciputi-AT-libero.it> for writing it.
3997
4003
3998 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4004 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3999 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4005 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4000
4006
4001 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4007 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4002 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4008 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4003 <syver-en-AT-online.no> who both submitted patches for this problem.
4009 <syver-en-AT-online.no> who both submitted patches for this problem.
4004
4010
4005 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4011 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4006 global embedding to make sure that things don't overwrite user
4012 global embedding to make sure that things don't overwrite user
4007 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4013 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4008
4014
4009 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4015 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4010 compatibility. Thanks to Hayden Callow
4016 compatibility. Thanks to Hayden Callow
4011 <h.callow-AT-elec.canterbury.ac.nz>
4017 <h.callow-AT-elec.canterbury.ac.nz>
4012
4018
4013 2002-10-04 Fernando Perez <fperez@colorado.edu>
4019 2002-10-04 Fernando Perez <fperez@colorado.edu>
4014
4020
4015 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4021 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4016 Gnuplot.File objects.
4022 Gnuplot.File objects.
4017
4023
4018 2002-07-23 Fernando Perez <fperez@colorado.edu>
4024 2002-07-23 Fernando Perez <fperez@colorado.edu>
4019
4025
4020 * IPython/genutils.py (timing): Added timings() and timing() for
4026 * IPython/genutils.py (timing): Added timings() and timing() for
4021 quick access to the most commonly needed data, the execution
4027 quick access to the most commonly needed data, the execution
4022 times. Old timing() renamed to timings_out().
4028 times. Old timing() renamed to timings_out().
4023
4029
4024 2002-07-18 Fernando Perez <fperez@colorado.edu>
4030 2002-07-18 Fernando Perez <fperez@colorado.edu>
4025
4031
4026 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4032 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4027 bug with nested instances disrupting the parent's tab completion.
4033 bug with nested instances disrupting the parent's tab completion.
4028
4034
4029 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4035 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4030 all_completions code to begin the emacs integration.
4036 all_completions code to begin the emacs integration.
4031
4037
4032 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4038 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4033 argument to allow titling individual arrays when plotting.
4039 argument to allow titling individual arrays when plotting.
4034
4040
4035 2002-07-15 Fernando Perez <fperez@colorado.edu>
4041 2002-07-15 Fernando Perez <fperez@colorado.edu>
4036
4042
4037 * setup.py (make_shortcut): changed to retrieve the value of
4043 * setup.py (make_shortcut): changed to retrieve the value of
4038 'Program Files' directory from the registry (this value changes in
4044 'Program Files' directory from the registry (this value changes in
4039 non-english versions of Windows). Thanks to Thomas Fanslau
4045 non-english versions of Windows). Thanks to Thomas Fanslau
4040 <tfanslau-AT-gmx.de> for the report.
4046 <tfanslau-AT-gmx.de> for the report.
4041
4047
4042 2002-07-10 Fernando Perez <fperez@colorado.edu>
4048 2002-07-10 Fernando Perez <fperez@colorado.edu>
4043
4049
4044 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4050 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4045 a bug in pdb, which crashes if a line with only whitespace is
4051 a bug in pdb, which crashes if a line with only whitespace is
4046 entered. Bug report submitted to sourceforge.
4052 entered. Bug report submitted to sourceforge.
4047
4053
4048 2002-07-09 Fernando Perez <fperez@colorado.edu>
4054 2002-07-09 Fernando Perez <fperez@colorado.edu>
4049
4055
4050 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4056 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4051 reporting exceptions (it's a bug in inspect.py, I just set a
4057 reporting exceptions (it's a bug in inspect.py, I just set a
4052 workaround).
4058 workaround).
4053
4059
4054 2002-07-08 Fernando Perez <fperez@colorado.edu>
4060 2002-07-08 Fernando Perez <fperez@colorado.edu>
4055
4061
4056 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4062 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4057 __IPYTHON__ in __builtins__ to show up in user_ns.
4063 __IPYTHON__ in __builtins__ to show up in user_ns.
4058
4064
4059 2002-07-03 Fernando Perez <fperez@colorado.edu>
4065 2002-07-03 Fernando Perez <fperez@colorado.edu>
4060
4066
4061 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4067 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4062 name from @gp_set_instance to @gp_set_default.
4068 name from @gp_set_instance to @gp_set_default.
4063
4069
4064 * IPython/ipmaker.py (make_IPython): default editor value set to
4070 * IPython/ipmaker.py (make_IPython): default editor value set to
4065 '0' (a string), to match the rc file. Otherwise will crash when
4071 '0' (a string), to match the rc file. Otherwise will crash when
4066 .strip() is called on it.
4072 .strip() is called on it.
4067
4073
4068
4074
4069 2002-06-28 Fernando Perez <fperez@colorado.edu>
4075 2002-06-28 Fernando Perez <fperez@colorado.edu>
4070
4076
4071 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4077 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4072 of files in current directory when a file is executed via
4078 of files in current directory when a file is executed via
4073 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4079 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4074
4080
4075 * setup.py (manfiles): fix for rpm builds, submitted by RA
4081 * setup.py (manfiles): fix for rpm builds, submitted by RA
4076 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4082 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4077
4083
4078 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4084 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4079 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4085 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4080 string!). A. Schmolck caught this one.
4086 string!). A. Schmolck caught this one.
4081
4087
4082 2002-06-27 Fernando Perez <fperez@colorado.edu>
4088 2002-06-27 Fernando Perez <fperez@colorado.edu>
4083
4089
4084 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4090 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4085 defined files at the cmd line. __name__ wasn't being set to
4091 defined files at the cmd line. __name__ wasn't being set to
4086 __main__.
4092 __main__.
4087
4093
4088 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4094 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4089 regular lists and tuples besides Numeric arrays.
4095 regular lists and tuples besides Numeric arrays.
4090
4096
4091 * IPython/Prompts.py (CachedOutput.__call__): Added output
4097 * IPython/Prompts.py (CachedOutput.__call__): Added output
4092 supression for input ending with ';'. Similar to Mathematica and
4098 supression for input ending with ';'. Similar to Mathematica and
4093 Matlab. The _* vars and Out[] list are still updated, just like
4099 Matlab. The _* vars and Out[] list are still updated, just like
4094 Mathematica behaves.
4100 Mathematica behaves.
4095
4101
4096 2002-06-25 Fernando Perez <fperez@colorado.edu>
4102 2002-06-25 Fernando Perez <fperez@colorado.edu>
4097
4103
4098 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4104 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4099 .ini extensions for profiels under Windows.
4105 .ini extensions for profiels under Windows.
4100
4106
4101 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4107 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4102 string form. Fix contributed by Alexander Schmolck
4108 string form. Fix contributed by Alexander Schmolck
4103 <a.schmolck-AT-gmx.net>
4109 <a.schmolck-AT-gmx.net>
4104
4110
4105 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4111 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4106 pre-configured Gnuplot instance.
4112 pre-configured Gnuplot instance.
4107
4113
4108 2002-06-21 Fernando Perez <fperez@colorado.edu>
4114 2002-06-21 Fernando Perez <fperez@colorado.edu>
4109
4115
4110 * IPython/numutils.py (exp_safe): new function, works around the
4116 * IPython/numutils.py (exp_safe): new function, works around the
4111 underflow problems in Numeric.
4117 underflow problems in Numeric.
4112 (log2): New fn. Safe log in base 2: returns exact integer answer
4118 (log2): New fn. Safe log in base 2: returns exact integer answer
4113 for exact integer powers of 2.
4119 for exact integer powers of 2.
4114
4120
4115 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4121 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4116 properly.
4122 properly.
4117
4123
4118 2002-06-20 Fernando Perez <fperez@colorado.edu>
4124 2002-06-20 Fernando Perez <fperez@colorado.edu>
4119
4125
4120 * IPython/genutils.py (timing): new function like
4126 * IPython/genutils.py (timing): new function like
4121 Mathematica's. Similar to time_test, but returns more info.
4127 Mathematica's. Similar to time_test, but returns more info.
4122
4128
4123 2002-06-18 Fernando Perez <fperez@colorado.edu>
4129 2002-06-18 Fernando Perez <fperez@colorado.edu>
4124
4130
4125 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4131 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4126 according to Mike Heeter's suggestions.
4132 according to Mike Heeter's suggestions.
4127
4133
4128 2002-06-16 Fernando Perez <fperez@colorado.edu>
4134 2002-06-16 Fernando Perez <fperez@colorado.edu>
4129
4135
4130 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4136 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4131 system. GnuplotMagic is gone as a user-directory option. New files
4137 system. GnuplotMagic is gone as a user-directory option. New files
4132 make it easier to use all the gnuplot stuff both from external
4138 make it easier to use all the gnuplot stuff both from external
4133 programs as well as from IPython. Had to rewrite part of
4139 programs as well as from IPython. Had to rewrite part of
4134 hardcopy() b/c of a strange bug: often the ps files simply don't
4140 hardcopy() b/c of a strange bug: often the ps files simply don't
4135 get created, and require a repeat of the command (often several
4141 get created, and require a repeat of the command (often several
4136 times).
4142 times).
4137
4143
4138 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4144 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4139 resolve output channel at call time, so that if sys.stderr has
4145 resolve output channel at call time, so that if sys.stderr has
4140 been redirected by user this gets honored.
4146 been redirected by user this gets honored.
4141
4147
4142 2002-06-13 Fernando Perez <fperez@colorado.edu>
4148 2002-06-13 Fernando Perez <fperez@colorado.edu>
4143
4149
4144 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4150 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4145 IPShell. Kept a copy with the old names to avoid breaking people's
4151 IPShell. Kept a copy with the old names to avoid breaking people's
4146 embedded code.
4152 embedded code.
4147
4153
4148 * IPython/ipython: simplified it to the bare minimum after
4154 * IPython/ipython: simplified it to the bare minimum after
4149 Holger's suggestions. Added info about how to use it in
4155 Holger's suggestions. Added info about how to use it in
4150 PYTHONSTARTUP.
4156 PYTHONSTARTUP.
4151
4157
4152 * IPython/Shell.py (IPythonShell): changed the options passing
4158 * IPython/Shell.py (IPythonShell): changed the options passing
4153 from a string with funky %s replacements to a straight list. Maybe
4159 from a string with funky %s replacements to a straight list. Maybe
4154 a bit more typing, but it follows sys.argv conventions, so there's
4160 a bit more typing, but it follows sys.argv conventions, so there's
4155 less special-casing to remember.
4161 less special-casing to remember.
4156
4162
4157 2002-06-12 Fernando Perez <fperez@colorado.edu>
4163 2002-06-12 Fernando Perez <fperez@colorado.edu>
4158
4164
4159 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4165 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4160 command. Thanks to a suggestion by Mike Heeter.
4166 command. Thanks to a suggestion by Mike Heeter.
4161 (Magic.magic_pfile): added behavior to look at filenames if given
4167 (Magic.magic_pfile): added behavior to look at filenames if given
4162 arg is not a defined object.
4168 arg is not a defined object.
4163 (Magic.magic_save): New @save function to save code snippets. Also
4169 (Magic.magic_save): New @save function to save code snippets. Also
4164 a Mike Heeter idea.
4170 a Mike Heeter idea.
4165
4171
4166 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4172 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4167 plot() and replot(). Much more convenient now, especially for
4173 plot() and replot(). Much more convenient now, especially for
4168 interactive use.
4174 interactive use.
4169
4175
4170 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4176 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4171 filenames.
4177 filenames.
4172
4178
4173 2002-06-02 Fernando Perez <fperez@colorado.edu>
4179 2002-06-02 Fernando Perez <fperez@colorado.edu>
4174
4180
4175 * IPython/Struct.py (Struct.__init__): modified to admit
4181 * IPython/Struct.py (Struct.__init__): modified to admit
4176 initialization via another struct.
4182 initialization via another struct.
4177
4183
4178 * IPython/genutils.py (SystemExec.__init__): New stateful
4184 * IPython/genutils.py (SystemExec.__init__): New stateful
4179 interface to xsys and bq. Useful for writing system scripts.
4185 interface to xsys and bq. Useful for writing system scripts.
4180
4186
4181 2002-05-30 Fernando Perez <fperez@colorado.edu>
4187 2002-05-30 Fernando Perez <fperez@colorado.edu>
4182
4188
4183 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4189 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4184 documents. This will make the user download smaller (it's getting
4190 documents. This will make the user download smaller (it's getting
4185 too big).
4191 too big).
4186
4192
4187 2002-05-29 Fernando Perez <fperez@colorado.edu>
4193 2002-05-29 Fernando Perez <fperez@colorado.edu>
4188
4194
4189 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4195 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4190 fix problems with shelve and pickle. Seems to work, but I don't
4196 fix problems with shelve and pickle. Seems to work, but I don't
4191 know if corner cases break it. Thanks to Mike Heeter
4197 know if corner cases break it. Thanks to Mike Heeter
4192 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4198 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4193
4199
4194 2002-05-24 Fernando Perez <fperez@colorado.edu>
4200 2002-05-24 Fernando Perez <fperez@colorado.edu>
4195
4201
4196 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4202 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4197 macros having broken.
4203 macros having broken.
4198
4204
4199 2002-05-21 Fernando Perez <fperez@colorado.edu>
4205 2002-05-21 Fernando Perez <fperez@colorado.edu>
4200
4206
4201 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4207 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4202 introduced logging bug: all history before logging started was
4208 introduced logging bug: all history before logging started was
4203 being written one character per line! This came from the redesign
4209 being written one character per line! This came from the redesign
4204 of the input history as a special list which slices to strings,
4210 of the input history as a special list which slices to strings,
4205 not to lists.
4211 not to lists.
4206
4212
4207 2002-05-20 Fernando Perez <fperez@colorado.edu>
4213 2002-05-20 Fernando Perez <fperez@colorado.edu>
4208
4214
4209 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4215 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4210 be an attribute of all classes in this module. The design of these
4216 be an attribute of all classes in this module. The design of these
4211 classes needs some serious overhauling.
4217 classes needs some serious overhauling.
4212
4218
4213 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4219 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4214 which was ignoring '_' in option names.
4220 which was ignoring '_' in option names.
4215
4221
4216 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4222 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4217 'Verbose_novars' to 'Context' and made it the new default. It's a
4223 'Verbose_novars' to 'Context' and made it the new default. It's a
4218 bit more readable and also safer than verbose.
4224 bit more readable and also safer than verbose.
4219
4225
4220 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4226 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4221 triple-quoted strings.
4227 triple-quoted strings.
4222
4228
4223 * IPython/OInspect.py (__all__): new module exposing the object
4229 * IPython/OInspect.py (__all__): new module exposing the object
4224 introspection facilities. Now the corresponding magics are dummy
4230 introspection facilities. Now the corresponding magics are dummy
4225 wrappers around this. Having this module will make it much easier
4231 wrappers around this. Having this module will make it much easier
4226 to put these functions into our modified pdb.
4232 to put these functions into our modified pdb.
4227 This new object inspector system uses the new colorizing module,
4233 This new object inspector system uses the new colorizing module,
4228 so source code and other things are nicely syntax highlighted.
4234 so source code and other things are nicely syntax highlighted.
4229
4235
4230 2002-05-18 Fernando Perez <fperez@colorado.edu>
4236 2002-05-18 Fernando Perez <fperez@colorado.edu>
4231
4237
4232 * IPython/ColorANSI.py: Split the coloring tools into a separate
4238 * IPython/ColorANSI.py: Split the coloring tools into a separate
4233 module so I can use them in other code easier (they were part of
4239 module so I can use them in other code easier (they were part of
4234 ultraTB).
4240 ultraTB).
4235
4241
4236 2002-05-17 Fernando Perez <fperez@colorado.edu>
4242 2002-05-17 Fernando Perez <fperez@colorado.edu>
4237
4243
4238 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4244 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4239 fixed it to set the global 'g' also to the called instance, as
4245 fixed it to set the global 'g' also to the called instance, as
4240 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4246 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4241 user's 'g' variables).
4247 user's 'g' variables).
4242
4248
4243 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4249 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4244 global variables (aliases to _ih,_oh) so that users which expect
4250 global variables (aliases to _ih,_oh) so that users which expect
4245 In[5] or Out[7] to work aren't unpleasantly surprised.
4251 In[5] or Out[7] to work aren't unpleasantly surprised.
4246 (InputList.__getslice__): new class to allow executing slices of
4252 (InputList.__getslice__): new class to allow executing slices of
4247 input history directly. Very simple class, complements the use of
4253 input history directly. Very simple class, complements the use of
4248 macros.
4254 macros.
4249
4255
4250 2002-05-16 Fernando Perez <fperez@colorado.edu>
4256 2002-05-16 Fernando Perez <fperez@colorado.edu>
4251
4257
4252 * setup.py (docdirbase): make doc directory be just doc/IPython
4258 * setup.py (docdirbase): make doc directory be just doc/IPython
4253 without version numbers, it will reduce clutter for users.
4259 without version numbers, it will reduce clutter for users.
4254
4260
4255 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4261 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4256 execfile call to prevent possible memory leak. See for details:
4262 execfile call to prevent possible memory leak. See for details:
4257 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4263 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4258
4264
4259 2002-05-15 Fernando Perez <fperez@colorado.edu>
4265 2002-05-15 Fernando Perez <fperez@colorado.edu>
4260
4266
4261 * IPython/Magic.py (Magic.magic_psource): made the object
4267 * IPython/Magic.py (Magic.magic_psource): made the object
4262 introspection names be more standard: pdoc, pdef, pfile and
4268 introspection names be more standard: pdoc, pdef, pfile and
4263 psource. They all print/page their output, and it makes
4269 psource. They all print/page their output, and it makes
4264 remembering them easier. Kept old names for compatibility as
4270 remembering them easier. Kept old names for compatibility as
4265 aliases.
4271 aliases.
4266
4272
4267 2002-05-14 Fernando Perez <fperez@colorado.edu>
4273 2002-05-14 Fernando Perez <fperez@colorado.edu>
4268
4274
4269 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4275 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4270 what the mouse problem was. The trick is to use gnuplot with temp
4276 what the mouse problem was. The trick is to use gnuplot with temp
4271 files and NOT with pipes (for data communication), because having
4277 files and NOT with pipes (for data communication), because having
4272 both pipes and the mouse on is bad news.
4278 both pipes and the mouse on is bad news.
4273
4279
4274 2002-05-13 Fernando Perez <fperez@colorado.edu>
4280 2002-05-13 Fernando Perez <fperez@colorado.edu>
4275
4281
4276 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4282 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4277 bug. Information would be reported about builtins even when
4283 bug. Information would be reported about builtins even when
4278 user-defined functions overrode them.
4284 user-defined functions overrode them.
4279
4285
4280 2002-05-11 Fernando Perez <fperez@colorado.edu>
4286 2002-05-11 Fernando Perez <fperez@colorado.edu>
4281
4287
4282 * IPython/__init__.py (__all__): removed FlexCompleter from
4288 * IPython/__init__.py (__all__): removed FlexCompleter from
4283 __all__ so that things don't fail in platforms without readline.
4289 __all__ so that things don't fail in platforms without readline.
4284
4290
4285 2002-05-10 Fernando Perez <fperez@colorado.edu>
4291 2002-05-10 Fernando Perez <fperez@colorado.edu>
4286
4292
4287 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4293 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4288 it requires Numeric, effectively making Numeric a dependency for
4294 it requires Numeric, effectively making Numeric a dependency for
4289 IPython.
4295 IPython.
4290
4296
4291 * Released 0.2.13
4297 * Released 0.2.13
4292
4298
4293 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4299 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4294 profiler interface. Now all the major options from the profiler
4300 profiler interface. Now all the major options from the profiler
4295 module are directly supported in IPython, both for single
4301 module are directly supported in IPython, both for single
4296 expressions (@prun) and for full programs (@run -p).
4302 expressions (@prun) and for full programs (@run -p).
4297
4303
4298 2002-05-09 Fernando Perez <fperez@colorado.edu>
4304 2002-05-09 Fernando Perez <fperez@colorado.edu>
4299
4305
4300 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4306 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4301 magic properly formatted for screen.
4307 magic properly formatted for screen.
4302
4308
4303 * setup.py (make_shortcut): Changed things to put pdf version in
4309 * setup.py (make_shortcut): Changed things to put pdf version in
4304 doc/ instead of doc/manual (had to change lyxport a bit).
4310 doc/ instead of doc/manual (had to change lyxport a bit).
4305
4311
4306 * IPython/Magic.py (Profile.string_stats): made profile runs go
4312 * IPython/Magic.py (Profile.string_stats): made profile runs go
4307 through pager (they are long and a pager allows searching, saving,
4313 through pager (they are long and a pager allows searching, saving,
4308 etc.)
4314 etc.)
4309
4315
4310 2002-05-08 Fernando Perez <fperez@colorado.edu>
4316 2002-05-08 Fernando Perez <fperez@colorado.edu>
4311
4317
4312 * Released 0.2.12
4318 * Released 0.2.12
4313
4319
4314 2002-05-06 Fernando Perez <fperez@colorado.edu>
4320 2002-05-06 Fernando Perez <fperez@colorado.edu>
4315
4321
4316 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4322 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4317 introduced); 'hist n1 n2' was broken.
4323 introduced); 'hist n1 n2' was broken.
4318 (Magic.magic_pdb): added optional on/off arguments to @pdb
4324 (Magic.magic_pdb): added optional on/off arguments to @pdb
4319 (Magic.magic_run): added option -i to @run, which executes code in
4325 (Magic.magic_run): added option -i to @run, which executes code in
4320 the IPython namespace instead of a clean one. Also added @irun as
4326 the IPython namespace instead of a clean one. Also added @irun as
4321 an alias to @run -i.
4327 an alias to @run -i.
4322
4328
4323 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4329 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4324 fixed (it didn't really do anything, the namespaces were wrong).
4330 fixed (it didn't really do anything, the namespaces were wrong).
4325
4331
4326 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4332 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4327
4333
4328 * IPython/__init__.py (__all__): Fixed package namespace, now
4334 * IPython/__init__.py (__all__): Fixed package namespace, now
4329 'import IPython' does give access to IPython.<all> as
4335 'import IPython' does give access to IPython.<all> as
4330 expected. Also renamed __release__ to Release.
4336 expected. Also renamed __release__ to Release.
4331
4337
4332 * IPython/Debugger.py (__license__): created new Pdb class which
4338 * IPython/Debugger.py (__license__): created new Pdb class which
4333 functions like a drop-in for the normal pdb.Pdb but does NOT
4339 functions like a drop-in for the normal pdb.Pdb but does NOT
4334 import readline by default. This way it doesn't muck up IPython's
4340 import readline by default. This way it doesn't muck up IPython's
4335 readline handling, and now tab-completion finally works in the
4341 readline handling, and now tab-completion finally works in the
4336 debugger -- sort of. It completes things globally visible, but the
4342 debugger -- sort of. It completes things globally visible, but the
4337 completer doesn't track the stack as pdb walks it. That's a bit
4343 completer doesn't track the stack as pdb walks it. That's a bit
4338 tricky, and I'll have to implement it later.
4344 tricky, and I'll have to implement it later.
4339
4345
4340 2002-05-05 Fernando Perez <fperez@colorado.edu>
4346 2002-05-05 Fernando Perez <fperez@colorado.edu>
4341
4347
4342 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4348 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4343 magic docstrings when printed via ? (explicit \'s were being
4349 magic docstrings when printed via ? (explicit \'s were being
4344 printed).
4350 printed).
4345
4351
4346 * IPython/ipmaker.py (make_IPython): fixed namespace
4352 * IPython/ipmaker.py (make_IPython): fixed namespace
4347 identification bug. Now variables loaded via logs or command-line
4353 identification bug. Now variables loaded via logs or command-line
4348 files are recognized in the interactive namespace by @who.
4354 files are recognized in the interactive namespace by @who.
4349
4355
4350 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4356 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4351 log replay system stemming from the string form of Structs.
4357 log replay system stemming from the string form of Structs.
4352
4358
4353 * IPython/Magic.py (Macro.__init__): improved macros to properly
4359 * IPython/Magic.py (Macro.__init__): improved macros to properly
4354 handle magic commands in them.
4360 handle magic commands in them.
4355 (Magic.magic_logstart): usernames are now expanded so 'logstart
4361 (Magic.magic_logstart): usernames are now expanded so 'logstart
4356 ~/mylog' now works.
4362 ~/mylog' now works.
4357
4363
4358 * IPython/iplib.py (complete): fixed bug where paths starting with
4364 * IPython/iplib.py (complete): fixed bug where paths starting with
4359 '/' would be completed as magic names.
4365 '/' would be completed as magic names.
4360
4366
4361 2002-05-04 Fernando Perez <fperez@colorado.edu>
4367 2002-05-04 Fernando Perez <fperez@colorado.edu>
4362
4368
4363 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4369 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4364 allow running full programs under the profiler's control.
4370 allow running full programs under the profiler's control.
4365
4371
4366 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4372 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4367 mode to report exceptions verbosely but without formatting
4373 mode to report exceptions verbosely but without formatting
4368 variables. This addresses the issue of ipython 'freezing' (it's
4374 variables. This addresses the issue of ipython 'freezing' (it's
4369 not frozen, but caught in an expensive formatting loop) when huge
4375 not frozen, but caught in an expensive formatting loop) when huge
4370 variables are in the context of an exception.
4376 variables are in the context of an exception.
4371 (VerboseTB.text): Added '--->' markers at line where exception was
4377 (VerboseTB.text): Added '--->' markers at line where exception was
4372 triggered. Much clearer to read, especially in NoColor modes.
4378 triggered. Much clearer to read, especially in NoColor modes.
4373
4379
4374 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4380 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4375 implemented in reverse when changing to the new parse_options().
4381 implemented in reverse when changing to the new parse_options().
4376
4382
4377 2002-05-03 Fernando Perez <fperez@colorado.edu>
4383 2002-05-03 Fernando Perez <fperez@colorado.edu>
4378
4384
4379 * IPython/Magic.py (Magic.parse_options): new function so that
4385 * IPython/Magic.py (Magic.parse_options): new function so that
4380 magics can parse options easier.
4386 magics can parse options easier.
4381 (Magic.magic_prun): new function similar to profile.run(),
4387 (Magic.magic_prun): new function similar to profile.run(),
4382 suggested by Chris Hart.
4388 suggested by Chris Hart.
4383 (Magic.magic_cd): fixed behavior so that it only changes if
4389 (Magic.magic_cd): fixed behavior so that it only changes if
4384 directory actually is in history.
4390 directory actually is in history.
4385
4391
4386 * IPython/usage.py (__doc__): added information about potential
4392 * IPython/usage.py (__doc__): added information about potential
4387 slowness of Verbose exception mode when there are huge data
4393 slowness of Verbose exception mode when there are huge data
4388 structures to be formatted (thanks to Archie Paulson).
4394 structures to be formatted (thanks to Archie Paulson).
4389
4395
4390 * IPython/ipmaker.py (make_IPython): Changed default logging
4396 * IPython/ipmaker.py (make_IPython): Changed default logging
4391 (when simply called with -log) to use curr_dir/ipython.log in
4397 (when simply called with -log) to use curr_dir/ipython.log in
4392 rotate mode. Fixed crash which was occuring with -log before
4398 rotate mode. Fixed crash which was occuring with -log before
4393 (thanks to Jim Boyle).
4399 (thanks to Jim Boyle).
4394
4400
4395 2002-05-01 Fernando Perez <fperez@colorado.edu>
4401 2002-05-01 Fernando Perez <fperez@colorado.edu>
4396
4402
4397 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4403 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4398 was nasty -- though somewhat of a corner case).
4404 was nasty -- though somewhat of a corner case).
4399
4405
4400 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4406 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4401 text (was a bug).
4407 text (was a bug).
4402
4408
4403 2002-04-30 Fernando Perez <fperez@colorado.edu>
4409 2002-04-30 Fernando Perez <fperez@colorado.edu>
4404
4410
4405 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4411 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4406 a print after ^D or ^C from the user so that the In[] prompt
4412 a print after ^D or ^C from the user so that the In[] prompt
4407 doesn't over-run the gnuplot one.
4413 doesn't over-run the gnuplot one.
4408
4414
4409 2002-04-29 Fernando Perez <fperez@colorado.edu>
4415 2002-04-29 Fernando Perez <fperez@colorado.edu>
4410
4416
4411 * Released 0.2.10
4417 * Released 0.2.10
4412
4418
4413 * IPython/__release__.py (version): get date dynamically.
4419 * IPython/__release__.py (version): get date dynamically.
4414
4420
4415 * Misc. documentation updates thanks to Arnd's comments. Also ran
4421 * Misc. documentation updates thanks to Arnd's comments. Also ran
4416 a full spellcheck on the manual (hadn't been done in a while).
4422 a full spellcheck on the manual (hadn't been done in a while).
4417
4423
4418 2002-04-27 Fernando Perez <fperez@colorado.edu>
4424 2002-04-27 Fernando Perez <fperez@colorado.edu>
4419
4425
4420 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4426 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4421 starting a log in mid-session would reset the input history list.
4427 starting a log in mid-session would reset the input history list.
4422
4428
4423 2002-04-26 Fernando Perez <fperez@colorado.edu>
4429 2002-04-26 Fernando Perez <fperez@colorado.edu>
4424
4430
4425 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4431 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4426 all files were being included in an update. Now anything in
4432 all files were being included in an update. Now anything in
4427 UserConfig that matches [A-Za-z]*.py will go (this excludes
4433 UserConfig that matches [A-Za-z]*.py will go (this excludes
4428 __init__.py)
4434 __init__.py)
4429
4435
4430 2002-04-25 Fernando Perez <fperez@colorado.edu>
4436 2002-04-25 Fernando Perez <fperez@colorado.edu>
4431
4437
4432 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4438 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4433 to __builtins__ so that any form of embedded or imported code can
4439 to __builtins__ so that any form of embedded or imported code can
4434 test for being inside IPython.
4440 test for being inside IPython.
4435
4441
4436 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4442 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4437 changed to GnuplotMagic because it's now an importable module,
4443 changed to GnuplotMagic because it's now an importable module,
4438 this makes the name follow that of the standard Gnuplot module.
4444 this makes the name follow that of the standard Gnuplot module.
4439 GnuplotMagic can now be loaded at any time in mid-session.
4445 GnuplotMagic can now be loaded at any time in mid-session.
4440
4446
4441 2002-04-24 Fernando Perez <fperez@colorado.edu>
4447 2002-04-24 Fernando Perez <fperez@colorado.edu>
4442
4448
4443 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4449 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4444 the globals (IPython has its own namespace) and the
4450 the globals (IPython has its own namespace) and the
4445 PhysicalQuantity stuff is much better anyway.
4451 PhysicalQuantity stuff is much better anyway.
4446
4452
4447 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4453 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4448 embedding example to standard user directory for
4454 embedding example to standard user directory for
4449 distribution. Also put it in the manual.
4455 distribution. Also put it in the manual.
4450
4456
4451 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4457 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4452 instance as first argument (so it doesn't rely on some obscure
4458 instance as first argument (so it doesn't rely on some obscure
4453 hidden global).
4459 hidden global).
4454
4460
4455 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4461 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4456 delimiters. While it prevents ().TAB from working, it allows
4462 delimiters. While it prevents ().TAB from working, it allows
4457 completions in open (... expressions. This is by far a more common
4463 completions in open (... expressions. This is by far a more common
4458 case.
4464 case.
4459
4465
4460 2002-04-23 Fernando Perez <fperez@colorado.edu>
4466 2002-04-23 Fernando Perez <fperez@colorado.edu>
4461
4467
4462 * IPython/Extensions/InterpreterPasteInput.py: new
4468 * IPython/Extensions/InterpreterPasteInput.py: new
4463 syntax-processing module for pasting lines with >>> or ... at the
4469 syntax-processing module for pasting lines with >>> or ... at the
4464 start.
4470 start.
4465
4471
4466 * IPython/Extensions/PhysicalQ_Interactive.py
4472 * IPython/Extensions/PhysicalQ_Interactive.py
4467 (PhysicalQuantityInteractive.__int__): fixed to work with either
4473 (PhysicalQuantityInteractive.__int__): fixed to work with either
4468 Numeric or math.
4474 Numeric or math.
4469
4475
4470 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4476 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4471 provided profiles. Now we have:
4477 provided profiles. Now we have:
4472 -math -> math module as * and cmath with its own namespace.
4478 -math -> math module as * and cmath with its own namespace.
4473 -numeric -> Numeric as *, plus gnuplot & grace
4479 -numeric -> Numeric as *, plus gnuplot & grace
4474 -physics -> same as before
4480 -physics -> same as before
4475
4481
4476 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4482 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4477 user-defined magics wouldn't be found by @magic if they were
4483 user-defined magics wouldn't be found by @magic if they were
4478 defined as class methods. Also cleaned up the namespace search
4484 defined as class methods. Also cleaned up the namespace search
4479 logic and the string building (to use %s instead of many repeated
4485 logic and the string building (to use %s instead of many repeated
4480 string adds).
4486 string adds).
4481
4487
4482 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4488 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4483 of user-defined magics to operate with class methods (cleaner, in
4489 of user-defined magics to operate with class methods (cleaner, in
4484 line with the gnuplot code).
4490 line with the gnuplot code).
4485
4491
4486 2002-04-22 Fernando Perez <fperez@colorado.edu>
4492 2002-04-22 Fernando Perez <fperez@colorado.edu>
4487
4493
4488 * setup.py: updated dependency list so that manual is updated when
4494 * setup.py: updated dependency list so that manual is updated when
4489 all included files change.
4495 all included files change.
4490
4496
4491 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4497 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4492 the delimiter removal option (the fix is ugly right now).
4498 the delimiter removal option (the fix is ugly right now).
4493
4499
4494 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4500 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4495 all of the math profile (quicker loading, no conflict between
4501 all of the math profile (quicker loading, no conflict between
4496 g-9.8 and g-gnuplot).
4502 g-9.8 and g-gnuplot).
4497
4503
4498 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4504 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4499 name of post-mortem files to IPython_crash_report.txt.
4505 name of post-mortem files to IPython_crash_report.txt.
4500
4506
4501 * Cleanup/update of the docs. Added all the new readline info and
4507 * Cleanup/update of the docs. Added all the new readline info and
4502 formatted all lists as 'real lists'.
4508 formatted all lists as 'real lists'.
4503
4509
4504 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4510 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4505 tab-completion options, since the full readline parse_and_bind is
4511 tab-completion options, since the full readline parse_and_bind is
4506 now accessible.
4512 now accessible.
4507
4513
4508 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4514 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4509 handling of readline options. Now users can specify any string to
4515 handling of readline options. Now users can specify any string to
4510 be passed to parse_and_bind(), as well as the delimiters to be
4516 be passed to parse_and_bind(), as well as the delimiters to be
4511 removed.
4517 removed.
4512 (InteractiveShell.__init__): Added __name__ to the global
4518 (InteractiveShell.__init__): Added __name__ to the global
4513 namespace so that things like Itpl which rely on its existence
4519 namespace so that things like Itpl which rely on its existence
4514 don't crash.
4520 don't crash.
4515 (InteractiveShell._prefilter): Defined the default with a _ so
4521 (InteractiveShell._prefilter): Defined the default with a _ so
4516 that prefilter() is easier to override, while the default one
4522 that prefilter() is easier to override, while the default one
4517 remains available.
4523 remains available.
4518
4524
4519 2002-04-18 Fernando Perez <fperez@colorado.edu>
4525 2002-04-18 Fernando Perez <fperez@colorado.edu>
4520
4526
4521 * Added information about pdb in the docs.
4527 * Added information about pdb in the docs.
4522
4528
4523 2002-04-17 Fernando Perez <fperez@colorado.edu>
4529 2002-04-17 Fernando Perez <fperez@colorado.edu>
4524
4530
4525 * IPython/ipmaker.py (make_IPython): added rc_override option to
4531 * IPython/ipmaker.py (make_IPython): added rc_override option to
4526 allow passing config options at creation time which may override
4532 allow passing config options at creation time which may override
4527 anything set in the config files or command line. This is
4533 anything set in the config files or command line. This is
4528 particularly useful for configuring embedded instances.
4534 particularly useful for configuring embedded instances.
4529
4535
4530 2002-04-15 Fernando Perez <fperez@colorado.edu>
4536 2002-04-15 Fernando Perez <fperez@colorado.edu>
4531
4537
4532 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4538 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4533 crash embedded instances because of the input cache falling out of
4539 crash embedded instances because of the input cache falling out of
4534 sync with the output counter.
4540 sync with the output counter.
4535
4541
4536 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4542 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4537 mode which calls pdb after an uncaught exception in IPython itself.
4543 mode which calls pdb after an uncaught exception in IPython itself.
4538
4544
4539 2002-04-14 Fernando Perez <fperez@colorado.edu>
4545 2002-04-14 Fernando Perez <fperez@colorado.edu>
4540
4546
4541 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4547 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4542 readline, fix it back after each call.
4548 readline, fix it back after each call.
4543
4549
4544 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4550 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4545 method to force all access via __call__(), which guarantees that
4551 method to force all access via __call__(), which guarantees that
4546 traceback references are properly deleted.
4552 traceback references are properly deleted.
4547
4553
4548 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4554 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4549 improve printing when pprint is in use.
4555 improve printing when pprint is in use.
4550
4556
4551 2002-04-13 Fernando Perez <fperez@colorado.edu>
4557 2002-04-13 Fernando Perez <fperez@colorado.edu>
4552
4558
4553 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4559 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4554 exceptions aren't caught anymore. If the user triggers one, he
4560 exceptions aren't caught anymore. If the user triggers one, he
4555 should know why he's doing it and it should go all the way up,
4561 should know why he's doing it and it should go all the way up,
4556 just like any other exception. So now @abort will fully kill the
4562 just like any other exception. So now @abort will fully kill the
4557 embedded interpreter and the embedding code (unless that happens
4563 embedded interpreter and the embedding code (unless that happens
4558 to catch SystemExit).
4564 to catch SystemExit).
4559
4565
4560 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4566 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4561 and a debugger() method to invoke the interactive pdb debugger
4567 and a debugger() method to invoke the interactive pdb debugger
4562 after printing exception information. Also added the corresponding
4568 after printing exception information. Also added the corresponding
4563 -pdb option and @pdb magic to control this feature, and updated
4569 -pdb option and @pdb magic to control this feature, and updated
4564 the docs. After a suggestion from Christopher Hart
4570 the docs. After a suggestion from Christopher Hart
4565 (hart-AT-caltech.edu).
4571 (hart-AT-caltech.edu).
4566
4572
4567 2002-04-12 Fernando Perez <fperez@colorado.edu>
4573 2002-04-12 Fernando Perez <fperez@colorado.edu>
4568
4574
4569 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4575 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4570 the exception handlers defined by the user (not the CrashHandler)
4576 the exception handlers defined by the user (not the CrashHandler)
4571 so that user exceptions don't trigger an ipython bug report.
4577 so that user exceptions don't trigger an ipython bug report.
4572
4578
4573 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4579 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4574 configurable (it should have always been so).
4580 configurable (it should have always been so).
4575
4581
4576 2002-03-26 Fernando Perez <fperez@colorado.edu>
4582 2002-03-26 Fernando Perez <fperez@colorado.edu>
4577
4583
4578 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4584 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4579 and there to fix embedding namespace issues. This should all be
4585 and there to fix embedding namespace issues. This should all be
4580 done in a more elegant way.
4586 done in a more elegant way.
4581
4587
4582 2002-03-25 Fernando Perez <fperez@colorado.edu>
4588 2002-03-25 Fernando Perez <fperez@colorado.edu>
4583
4589
4584 * IPython/genutils.py (get_home_dir): Try to make it work under
4590 * IPython/genutils.py (get_home_dir): Try to make it work under
4585 win9x also.
4591 win9x also.
4586
4592
4587 2002-03-20 Fernando Perez <fperez@colorado.edu>
4593 2002-03-20 Fernando Perez <fperez@colorado.edu>
4588
4594
4589 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4595 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4590 sys.displayhook untouched upon __init__.
4596 sys.displayhook untouched upon __init__.
4591
4597
4592 2002-03-19 Fernando Perez <fperez@colorado.edu>
4598 2002-03-19 Fernando Perez <fperez@colorado.edu>
4593
4599
4594 * Released 0.2.9 (for embedding bug, basically).
4600 * Released 0.2.9 (for embedding bug, basically).
4595
4601
4596 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4602 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4597 exceptions so that enclosing shell's state can be restored.
4603 exceptions so that enclosing shell's state can be restored.
4598
4604
4599 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4605 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4600 naming conventions in the .ipython/ dir.
4606 naming conventions in the .ipython/ dir.
4601
4607
4602 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4608 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4603 from delimiters list so filenames with - in them get expanded.
4609 from delimiters list so filenames with - in them get expanded.
4604
4610
4605 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4611 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4606 sys.displayhook not being properly restored after an embedded call.
4612 sys.displayhook not being properly restored after an embedded call.
4607
4613
4608 2002-03-18 Fernando Perez <fperez@colorado.edu>
4614 2002-03-18 Fernando Perez <fperez@colorado.edu>
4609
4615
4610 * Released 0.2.8
4616 * Released 0.2.8
4611
4617
4612 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4618 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4613 some files weren't being included in a -upgrade.
4619 some files weren't being included in a -upgrade.
4614 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4620 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4615 on' so that the first tab completes.
4621 on' so that the first tab completes.
4616 (InteractiveShell.handle_magic): fixed bug with spaces around
4622 (InteractiveShell.handle_magic): fixed bug with spaces around
4617 quotes breaking many magic commands.
4623 quotes breaking many magic commands.
4618
4624
4619 * setup.py: added note about ignoring the syntax error messages at
4625 * setup.py: added note about ignoring the syntax error messages at
4620 installation.
4626 installation.
4621
4627
4622 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4628 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4623 streamlining the gnuplot interface, now there's only one magic @gp.
4629 streamlining the gnuplot interface, now there's only one magic @gp.
4624
4630
4625 2002-03-17 Fernando Perez <fperez@colorado.edu>
4631 2002-03-17 Fernando Perez <fperez@colorado.edu>
4626
4632
4627 * IPython/UserConfig/magic_gnuplot.py: new name for the
4633 * IPython/UserConfig/magic_gnuplot.py: new name for the
4628 example-magic_pm.py file. Much enhanced system, now with a shell
4634 example-magic_pm.py file. Much enhanced system, now with a shell
4629 for communicating directly with gnuplot, one command at a time.
4635 for communicating directly with gnuplot, one command at a time.
4630
4636
4631 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4637 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4632 setting __name__=='__main__'.
4638 setting __name__=='__main__'.
4633
4639
4634 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4640 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4635 mini-shell for accessing gnuplot from inside ipython. Should
4641 mini-shell for accessing gnuplot from inside ipython. Should
4636 extend it later for grace access too. Inspired by Arnd's
4642 extend it later for grace access too. Inspired by Arnd's
4637 suggestion.
4643 suggestion.
4638
4644
4639 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4645 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4640 calling magic functions with () in their arguments. Thanks to Arnd
4646 calling magic functions with () in their arguments. Thanks to Arnd
4641 Baecker for pointing this to me.
4647 Baecker for pointing this to me.
4642
4648
4643 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4649 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4644 infinitely for integer or complex arrays (only worked with floats).
4650 infinitely for integer or complex arrays (only worked with floats).
4645
4651
4646 2002-03-16 Fernando Perez <fperez@colorado.edu>
4652 2002-03-16 Fernando Perez <fperez@colorado.edu>
4647
4653
4648 * setup.py: Merged setup and setup_windows into a single script
4654 * setup.py: Merged setup and setup_windows into a single script
4649 which properly handles things for windows users.
4655 which properly handles things for windows users.
4650
4656
4651 2002-03-15 Fernando Perez <fperez@colorado.edu>
4657 2002-03-15 Fernando Perez <fperez@colorado.edu>
4652
4658
4653 * Big change to the manual: now the magics are all automatically
4659 * Big change to the manual: now the magics are all automatically
4654 documented. This information is generated from their docstrings
4660 documented. This information is generated from their docstrings
4655 and put in a latex file included by the manual lyx file. This way
4661 and put in a latex file included by the manual lyx file. This way
4656 we get always up to date information for the magics. The manual
4662 we get always up to date information for the magics. The manual
4657 now also has proper version information, also auto-synced.
4663 now also has proper version information, also auto-synced.
4658
4664
4659 For this to work, an undocumented --magic_docstrings option was added.
4665 For this to work, an undocumented --magic_docstrings option was added.
4660
4666
4661 2002-03-13 Fernando Perez <fperez@colorado.edu>
4667 2002-03-13 Fernando Perez <fperez@colorado.edu>
4662
4668
4663 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4669 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4664 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4670 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4665
4671
4666 2002-03-12 Fernando Perez <fperez@colorado.edu>
4672 2002-03-12 Fernando Perez <fperez@colorado.edu>
4667
4673
4668 * IPython/ultraTB.py (TermColors): changed color escapes again to
4674 * IPython/ultraTB.py (TermColors): changed color escapes again to
4669 fix the (old, reintroduced) line-wrapping bug. Basically, if
4675 fix the (old, reintroduced) line-wrapping bug. Basically, if
4670 \001..\002 aren't given in the color escapes, lines get wrapped
4676 \001..\002 aren't given in the color escapes, lines get wrapped
4671 weirdly. But giving those screws up old xterms and emacs terms. So
4677 weirdly. But giving those screws up old xterms and emacs terms. So
4672 I added some logic for emacs terms to be ok, but I can't identify old
4678 I added some logic for emacs terms to be ok, but I can't identify old
4673 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4679 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4674
4680
4675 2002-03-10 Fernando Perez <fperez@colorado.edu>
4681 2002-03-10 Fernando Perez <fperez@colorado.edu>
4676
4682
4677 * IPython/usage.py (__doc__): Various documentation cleanups and
4683 * IPython/usage.py (__doc__): Various documentation cleanups and
4678 updates, both in usage docstrings and in the manual.
4684 updates, both in usage docstrings and in the manual.
4679
4685
4680 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4686 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4681 handling of caching. Set minimum acceptabe value for having a
4687 handling of caching. Set minimum acceptabe value for having a
4682 cache at 20 values.
4688 cache at 20 values.
4683
4689
4684 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4690 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4685 install_first_time function to a method, renamed it and added an
4691 install_first_time function to a method, renamed it and added an
4686 'upgrade' mode. Now people can update their config directory with
4692 'upgrade' mode. Now people can update their config directory with
4687 a simple command line switch (-upgrade, also new).
4693 a simple command line switch (-upgrade, also new).
4688
4694
4689 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4695 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4690 @file (convenient for automagic users under Python >= 2.2).
4696 @file (convenient for automagic users under Python >= 2.2).
4691 Removed @files (it seemed more like a plural than an abbrev. of
4697 Removed @files (it seemed more like a plural than an abbrev. of
4692 'file show').
4698 'file show').
4693
4699
4694 * IPython/iplib.py (install_first_time): Fixed crash if there were
4700 * IPython/iplib.py (install_first_time): Fixed crash if there were
4695 backup files ('~') in .ipython/ install directory.
4701 backup files ('~') in .ipython/ install directory.
4696
4702
4697 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4703 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4698 system. Things look fine, but these changes are fairly
4704 system. Things look fine, but these changes are fairly
4699 intrusive. Test them for a few days.
4705 intrusive. Test them for a few days.
4700
4706
4701 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4707 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4702 the prompts system. Now all in/out prompt strings are user
4708 the prompts system. Now all in/out prompt strings are user
4703 controllable. This is particularly useful for embedding, as one
4709 controllable. This is particularly useful for embedding, as one
4704 can tag embedded instances with particular prompts.
4710 can tag embedded instances with particular prompts.
4705
4711
4706 Also removed global use of sys.ps1/2, which now allows nested
4712 Also removed global use of sys.ps1/2, which now allows nested
4707 embeddings without any problems. Added command-line options for
4713 embeddings without any problems. Added command-line options for
4708 the prompt strings.
4714 the prompt strings.
4709
4715
4710 2002-03-08 Fernando Perez <fperez@colorado.edu>
4716 2002-03-08 Fernando Perez <fperez@colorado.edu>
4711
4717
4712 * IPython/UserConfig/example-embed-short.py (ipshell): added
4718 * IPython/UserConfig/example-embed-short.py (ipshell): added
4713 example file with the bare minimum code for embedding.
4719 example file with the bare minimum code for embedding.
4714
4720
4715 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4721 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4716 functionality for the embeddable shell to be activated/deactivated
4722 functionality for the embeddable shell to be activated/deactivated
4717 either globally or at each call.
4723 either globally or at each call.
4718
4724
4719 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4725 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4720 rewriting the prompt with '--->' for auto-inputs with proper
4726 rewriting the prompt with '--->' for auto-inputs with proper
4721 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4727 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4722 this is handled by the prompts class itself, as it should.
4728 this is handled by the prompts class itself, as it should.
4723
4729
4724 2002-03-05 Fernando Perez <fperez@colorado.edu>
4730 2002-03-05 Fernando Perez <fperez@colorado.edu>
4725
4731
4726 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4732 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4727 @logstart to avoid name clashes with the math log function.
4733 @logstart to avoid name clashes with the math log function.
4728
4734
4729 * Big updates to X/Emacs section of the manual.
4735 * Big updates to X/Emacs section of the manual.
4730
4736
4731 * Removed ipython_emacs. Milan explained to me how to pass
4737 * Removed ipython_emacs. Milan explained to me how to pass
4732 arguments to ipython through Emacs. Some day I'm going to end up
4738 arguments to ipython through Emacs. Some day I'm going to end up
4733 learning some lisp...
4739 learning some lisp...
4734
4740
4735 2002-03-04 Fernando Perez <fperez@colorado.edu>
4741 2002-03-04 Fernando Perez <fperez@colorado.edu>
4736
4742
4737 * IPython/ipython_emacs: Created script to be used as the
4743 * IPython/ipython_emacs: Created script to be used as the
4738 py-python-command Emacs variable so we can pass IPython
4744 py-python-command Emacs variable so we can pass IPython
4739 parameters. I can't figure out how to tell Emacs directly to pass
4745 parameters. I can't figure out how to tell Emacs directly to pass
4740 parameters to IPython, so a dummy shell script will do it.
4746 parameters to IPython, so a dummy shell script will do it.
4741
4747
4742 Other enhancements made for things to work better under Emacs'
4748 Other enhancements made for things to work better under Emacs'
4743 various types of terminals. Many thanks to Milan Zamazal
4749 various types of terminals. Many thanks to Milan Zamazal
4744 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4750 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4745
4751
4746 2002-03-01 Fernando Perez <fperez@colorado.edu>
4752 2002-03-01 Fernando Perez <fperez@colorado.edu>
4747
4753
4748 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4754 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4749 that loading of readline is now optional. This gives better
4755 that loading of readline is now optional. This gives better
4750 control to emacs users.
4756 control to emacs users.
4751
4757
4752 * IPython/ultraTB.py (__date__): Modified color escape sequences
4758 * IPython/ultraTB.py (__date__): Modified color escape sequences
4753 and now things work fine under xterm and in Emacs' term buffers
4759 and now things work fine under xterm and in Emacs' term buffers
4754 (though not shell ones). Well, in emacs you get colors, but all
4760 (though not shell ones). Well, in emacs you get colors, but all
4755 seem to be 'light' colors (no difference between dark and light
4761 seem to be 'light' colors (no difference between dark and light
4756 ones). But the garbage chars are gone, and also in xterms. It
4762 ones). But the garbage chars are gone, and also in xterms. It
4757 seems that now I'm using 'cleaner' ansi sequences.
4763 seems that now I'm using 'cleaner' ansi sequences.
4758
4764
4759 2002-02-21 Fernando Perez <fperez@colorado.edu>
4765 2002-02-21 Fernando Perez <fperez@colorado.edu>
4760
4766
4761 * Released 0.2.7 (mainly to publish the scoping fix).
4767 * Released 0.2.7 (mainly to publish the scoping fix).
4762
4768
4763 * IPython/Logger.py (Logger.logstate): added. A corresponding
4769 * IPython/Logger.py (Logger.logstate): added. A corresponding
4764 @logstate magic was created.
4770 @logstate magic was created.
4765
4771
4766 * IPython/Magic.py: fixed nested scoping problem under Python
4772 * IPython/Magic.py: fixed nested scoping problem under Python
4767 2.1.x (automagic wasn't working).
4773 2.1.x (automagic wasn't working).
4768
4774
4769 2002-02-20 Fernando Perez <fperez@colorado.edu>
4775 2002-02-20 Fernando Perez <fperez@colorado.edu>
4770
4776
4771 * Released 0.2.6.
4777 * Released 0.2.6.
4772
4778
4773 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4779 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4774 option so that logs can come out without any headers at all.
4780 option so that logs can come out without any headers at all.
4775
4781
4776 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4782 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4777 SciPy.
4783 SciPy.
4778
4784
4779 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4785 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4780 that embedded IPython calls don't require vars() to be explicitly
4786 that embedded IPython calls don't require vars() to be explicitly
4781 passed. Now they are extracted from the caller's frame (code
4787 passed. Now they are extracted from the caller's frame (code
4782 snatched from Eric Jones' weave). Added better documentation to
4788 snatched from Eric Jones' weave). Added better documentation to
4783 the section on embedding and the example file.
4789 the section on embedding and the example file.
4784
4790
4785 * IPython/genutils.py (page): Changed so that under emacs, it just
4791 * IPython/genutils.py (page): Changed so that under emacs, it just
4786 prints the string. You can then page up and down in the emacs
4792 prints the string. You can then page up and down in the emacs
4787 buffer itself. This is how the builtin help() works.
4793 buffer itself. This is how the builtin help() works.
4788
4794
4789 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4795 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4790 macro scoping: macros need to be executed in the user's namespace
4796 macro scoping: macros need to be executed in the user's namespace
4791 to work as if they had been typed by the user.
4797 to work as if they had been typed by the user.
4792
4798
4793 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4799 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4794 execute automatically (no need to type 'exec...'). They then
4800 execute automatically (no need to type 'exec...'). They then
4795 behave like 'true macros'. The printing system was also modified
4801 behave like 'true macros'. The printing system was also modified
4796 for this to work.
4802 for this to work.
4797
4803
4798 2002-02-19 Fernando Perez <fperez@colorado.edu>
4804 2002-02-19 Fernando Perez <fperez@colorado.edu>
4799
4805
4800 * IPython/genutils.py (page_file): new function for paging files
4806 * IPython/genutils.py (page_file): new function for paging files
4801 in an OS-independent way. Also necessary for file viewing to work
4807 in an OS-independent way. Also necessary for file viewing to work
4802 well inside Emacs buffers.
4808 well inside Emacs buffers.
4803 (page): Added checks for being in an emacs buffer.
4809 (page): Added checks for being in an emacs buffer.
4804 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4810 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4805 same bug in iplib.
4811 same bug in iplib.
4806
4812
4807 2002-02-18 Fernando Perez <fperez@colorado.edu>
4813 2002-02-18 Fernando Perez <fperez@colorado.edu>
4808
4814
4809 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4815 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4810 of readline so that IPython can work inside an Emacs buffer.
4816 of readline so that IPython can work inside an Emacs buffer.
4811
4817
4812 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4818 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4813 method signatures (they weren't really bugs, but it looks cleaner
4819 method signatures (they weren't really bugs, but it looks cleaner
4814 and keeps PyChecker happy).
4820 and keeps PyChecker happy).
4815
4821
4816 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4822 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4817 for implementing various user-defined hooks. Currently only
4823 for implementing various user-defined hooks. Currently only
4818 display is done.
4824 display is done.
4819
4825
4820 * IPython/Prompts.py (CachedOutput._display): changed display
4826 * IPython/Prompts.py (CachedOutput._display): changed display
4821 functions so that they can be dynamically changed by users easily.
4827 functions so that they can be dynamically changed by users easily.
4822
4828
4823 * IPython/Extensions/numeric_formats.py (num_display): added an
4829 * IPython/Extensions/numeric_formats.py (num_display): added an
4824 extension for printing NumPy arrays in flexible manners. It
4830 extension for printing NumPy arrays in flexible manners. It
4825 doesn't do anything yet, but all the structure is in
4831 doesn't do anything yet, but all the structure is in
4826 place. Ultimately the plan is to implement output format control
4832 place. Ultimately the plan is to implement output format control
4827 like in Octave.
4833 like in Octave.
4828
4834
4829 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4835 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4830 methods are found at run-time by all the automatic machinery.
4836 methods are found at run-time by all the automatic machinery.
4831
4837
4832 2002-02-17 Fernando Perez <fperez@colorado.edu>
4838 2002-02-17 Fernando Perez <fperez@colorado.edu>
4833
4839
4834 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4840 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4835 whole file a little.
4841 whole file a little.
4836
4842
4837 * ToDo: closed this document. Now there's a new_design.lyx
4843 * ToDo: closed this document. Now there's a new_design.lyx
4838 document for all new ideas. Added making a pdf of it for the
4844 document for all new ideas. Added making a pdf of it for the
4839 end-user distro.
4845 end-user distro.
4840
4846
4841 * IPython/Logger.py (Logger.switch_log): Created this to replace
4847 * IPython/Logger.py (Logger.switch_log): Created this to replace
4842 logon() and logoff(). It also fixes a nasty crash reported by
4848 logon() and logoff(). It also fixes a nasty crash reported by
4843 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4849 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4844
4850
4845 * IPython/iplib.py (complete): got auto-completion to work with
4851 * IPython/iplib.py (complete): got auto-completion to work with
4846 automagic (I had wanted this for a long time).
4852 automagic (I had wanted this for a long time).
4847
4853
4848 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4854 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4849 to @file, since file() is now a builtin and clashes with automagic
4855 to @file, since file() is now a builtin and clashes with automagic
4850 for @file.
4856 for @file.
4851
4857
4852 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4858 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4853 of this was previously in iplib, which had grown to more than 2000
4859 of this was previously in iplib, which had grown to more than 2000
4854 lines, way too long. No new functionality, but it makes managing
4860 lines, way too long. No new functionality, but it makes managing
4855 the code a bit easier.
4861 the code a bit easier.
4856
4862
4857 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4863 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4858 information to crash reports.
4864 information to crash reports.
4859
4865
4860 2002-02-12 Fernando Perez <fperez@colorado.edu>
4866 2002-02-12 Fernando Perez <fperez@colorado.edu>
4861
4867
4862 * Released 0.2.5.
4868 * Released 0.2.5.
4863
4869
4864 2002-02-11 Fernando Perez <fperez@colorado.edu>
4870 2002-02-11 Fernando Perez <fperez@colorado.edu>
4865
4871
4866 * Wrote a relatively complete Windows installer. It puts
4872 * Wrote a relatively complete Windows installer. It puts
4867 everything in place, creates Start Menu entries and fixes the
4873 everything in place, creates Start Menu entries and fixes the
4868 color issues. Nothing fancy, but it works.
4874 color issues. Nothing fancy, but it works.
4869
4875
4870 2002-02-10 Fernando Perez <fperez@colorado.edu>
4876 2002-02-10 Fernando Perez <fperez@colorado.edu>
4871
4877
4872 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4878 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4873 os.path.expanduser() call so that we can type @run ~/myfile.py and
4879 os.path.expanduser() call so that we can type @run ~/myfile.py and
4874 have thigs work as expected.
4880 have thigs work as expected.
4875
4881
4876 * IPython/genutils.py (page): fixed exception handling so things
4882 * IPython/genutils.py (page): fixed exception handling so things
4877 work both in Unix and Windows correctly. Quitting a pager triggers
4883 work both in Unix and Windows correctly. Quitting a pager triggers
4878 an IOError/broken pipe in Unix, and in windows not finding a pager
4884 an IOError/broken pipe in Unix, and in windows not finding a pager
4879 is also an IOError, so I had to actually look at the return value
4885 is also an IOError, so I had to actually look at the return value
4880 of the exception, not just the exception itself. Should be ok now.
4886 of the exception, not just the exception itself. Should be ok now.
4881
4887
4882 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4888 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4883 modified to allow case-insensitive color scheme changes.
4889 modified to allow case-insensitive color scheme changes.
4884
4890
4885 2002-02-09 Fernando Perez <fperez@colorado.edu>
4891 2002-02-09 Fernando Perez <fperez@colorado.edu>
4886
4892
4887 * IPython/genutils.py (native_line_ends): new function to leave
4893 * IPython/genutils.py (native_line_ends): new function to leave
4888 user config files with os-native line-endings.
4894 user config files with os-native line-endings.
4889
4895
4890 * README and manual updates.
4896 * README and manual updates.
4891
4897
4892 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4898 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4893 instead of StringType to catch Unicode strings.
4899 instead of StringType to catch Unicode strings.
4894
4900
4895 * IPython/genutils.py (filefind): fixed bug for paths with
4901 * IPython/genutils.py (filefind): fixed bug for paths with
4896 embedded spaces (very common in Windows).
4902 embedded spaces (very common in Windows).
4897
4903
4898 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4904 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4899 files under Windows, so that they get automatically associated
4905 files under Windows, so that they get automatically associated
4900 with a text editor. Windows makes it a pain to handle
4906 with a text editor. Windows makes it a pain to handle
4901 extension-less files.
4907 extension-less files.
4902
4908
4903 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4909 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4904 warning about readline only occur for Posix. In Windows there's no
4910 warning about readline only occur for Posix. In Windows there's no
4905 way to get readline, so why bother with the warning.
4911 way to get readline, so why bother with the warning.
4906
4912
4907 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4913 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4908 for __str__ instead of dir(self), since dir() changed in 2.2.
4914 for __str__ instead of dir(self), since dir() changed in 2.2.
4909
4915
4910 * Ported to Windows! Tested on XP, I suspect it should work fine
4916 * Ported to Windows! Tested on XP, I suspect it should work fine
4911 on NT/2000, but I don't think it will work on 98 et al. That
4917 on NT/2000, but I don't think it will work on 98 et al. That
4912 series of Windows is such a piece of junk anyway that I won't try
4918 series of Windows is such a piece of junk anyway that I won't try
4913 porting it there. The XP port was straightforward, showed a few
4919 porting it there. The XP port was straightforward, showed a few
4914 bugs here and there (fixed all), in particular some string
4920 bugs here and there (fixed all), in particular some string
4915 handling stuff which required considering Unicode strings (which
4921 handling stuff which required considering Unicode strings (which
4916 Windows uses). This is good, but hasn't been too tested :) No
4922 Windows uses). This is good, but hasn't been too tested :) No
4917 fancy installer yet, I'll put a note in the manual so people at
4923 fancy installer yet, I'll put a note in the manual so people at
4918 least make manually a shortcut.
4924 least make manually a shortcut.
4919
4925
4920 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4926 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4921 into a single one, "colors". This now controls both prompt and
4927 into a single one, "colors". This now controls both prompt and
4922 exception color schemes, and can be changed both at startup
4928 exception color schemes, and can be changed both at startup
4923 (either via command-line switches or via ipythonrc files) and at
4929 (either via command-line switches or via ipythonrc files) and at
4924 runtime, with @colors.
4930 runtime, with @colors.
4925 (Magic.magic_run): renamed @prun to @run and removed the old
4931 (Magic.magic_run): renamed @prun to @run and removed the old
4926 @run. The two were too similar to warrant keeping both.
4932 @run. The two were too similar to warrant keeping both.
4927
4933
4928 2002-02-03 Fernando Perez <fperez@colorado.edu>
4934 2002-02-03 Fernando Perez <fperez@colorado.edu>
4929
4935
4930 * IPython/iplib.py (install_first_time): Added comment on how to
4936 * IPython/iplib.py (install_first_time): Added comment on how to
4931 configure the color options for first-time users. Put a <return>
4937 configure the color options for first-time users. Put a <return>
4932 request at the end so that small-terminal users get a chance to
4938 request at the end so that small-terminal users get a chance to
4933 read the startup info.
4939 read the startup info.
4934
4940
4935 2002-01-23 Fernando Perez <fperez@colorado.edu>
4941 2002-01-23 Fernando Perez <fperez@colorado.edu>
4936
4942
4937 * IPython/iplib.py (CachedOutput.update): Changed output memory
4943 * IPython/iplib.py (CachedOutput.update): Changed output memory
4938 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4944 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4939 input history we still use _i. Did this b/c these variable are
4945 input history we still use _i. Did this b/c these variable are
4940 very commonly used in interactive work, so the less we need to
4946 very commonly used in interactive work, so the less we need to
4941 type the better off we are.
4947 type the better off we are.
4942 (Magic.magic_prun): updated @prun to better handle the namespaces
4948 (Magic.magic_prun): updated @prun to better handle the namespaces
4943 the file will run in, including a fix for __name__ not being set
4949 the file will run in, including a fix for __name__ not being set
4944 before.
4950 before.
4945
4951
4946 2002-01-20 Fernando Perez <fperez@colorado.edu>
4952 2002-01-20 Fernando Perez <fperez@colorado.edu>
4947
4953
4948 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4954 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4949 extra garbage for Python 2.2. Need to look more carefully into
4955 extra garbage for Python 2.2. Need to look more carefully into
4950 this later.
4956 this later.
4951
4957
4952 2002-01-19 Fernando Perez <fperez@colorado.edu>
4958 2002-01-19 Fernando Perez <fperez@colorado.edu>
4953
4959
4954 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4960 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4955 display SyntaxError exceptions properly formatted when they occur
4961 display SyntaxError exceptions properly formatted when they occur
4956 (they can be triggered by imported code).
4962 (they can be triggered by imported code).
4957
4963
4958 2002-01-18 Fernando Perez <fperez@colorado.edu>
4964 2002-01-18 Fernando Perez <fperez@colorado.edu>
4959
4965
4960 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4966 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4961 SyntaxError exceptions are reported nicely formatted, instead of
4967 SyntaxError exceptions are reported nicely formatted, instead of
4962 spitting out only offset information as before.
4968 spitting out only offset information as before.
4963 (Magic.magic_prun): Added the @prun function for executing
4969 (Magic.magic_prun): Added the @prun function for executing
4964 programs with command line args inside IPython.
4970 programs with command line args inside IPython.
4965
4971
4966 2002-01-16 Fernando Perez <fperez@colorado.edu>
4972 2002-01-16 Fernando Perez <fperez@colorado.edu>
4967
4973
4968 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4974 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4969 to *not* include the last item given in a range. This brings their
4975 to *not* include the last item given in a range. This brings their
4970 behavior in line with Python's slicing:
4976 behavior in line with Python's slicing:
4971 a[n1:n2] -> a[n1]...a[n2-1]
4977 a[n1:n2] -> a[n1]...a[n2-1]
4972 It may be a bit less convenient, but I prefer to stick to Python's
4978 It may be a bit less convenient, but I prefer to stick to Python's
4973 conventions *everywhere*, so users never have to wonder.
4979 conventions *everywhere*, so users never have to wonder.
4974 (Magic.magic_macro): Added @macro function to ease the creation of
4980 (Magic.magic_macro): Added @macro function to ease the creation of
4975 macros.
4981 macros.
4976
4982
4977 2002-01-05 Fernando Perez <fperez@colorado.edu>
4983 2002-01-05 Fernando Perez <fperez@colorado.edu>
4978
4984
4979 * Released 0.2.4.
4985 * Released 0.2.4.
4980
4986
4981 * IPython/iplib.py (Magic.magic_pdef):
4987 * IPython/iplib.py (Magic.magic_pdef):
4982 (InteractiveShell.safe_execfile): report magic lines and error
4988 (InteractiveShell.safe_execfile): report magic lines and error
4983 lines without line numbers so one can easily copy/paste them for
4989 lines without line numbers so one can easily copy/paste them for
4984 re-execution.
4990 re-execution.
4985
4991
4986 * Updated manual with recent changes.
4992 * Updated manual with recent changes.
4987
4993
4988 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4994 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4989 docstring printing when class? is called. Very handy for knowing
4995 docstring printing when class? is called. Very handy for knowing
4990 how to create class instances (as long as __init__ is well
4996 how to create class instances (as long as __init__ is well
4991 documented, of course :)
4997 documented, of course :)
4992 (Magic.magic_doc): print both class and constructor docstrings.
4998 (Magic.magic_doc): print both class and constructor docstrings.
4993 (Magic.magic_pdef): give constructor info if passed a class and
4999 (Magic.magic_pdef): give constructor info if passed a class and
4994 __call__ info for callable object instances.
5000 __call__ info for callable object instances.
4995
5001
4996 2002-01-04 Fernando Perez <fperez@colorado.edu>
5002 2002-01-04 Fernando Perez <fperez@colorado.edu>
4997
5003
4998 * Made deep_reload() off by default. It doesn't always work
5004 * Made deep_reload() off by default. It doesn't always work
4999 exactly as intended, so it's probably safer to have it off. It's
5005 exactly as intended, so it's probably safer to have it off. It's
5000 still available as dreload() anyway, so nothing is lost.
5006 still available as dreload() anyway, so nothing is lost.
5001
5007
5002 2002-01-02 Fernando Perez <fperez@colorado.edu>
5008 2002-01-02 Fernando Perez <fperez@colorado.edu>
5003
5009
5004 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5010 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5005 so I wanted an updated release).
5011 so I wanted an updated release).
5006
5012
5007 2001-12-27 Fernando Perez <fperez@colorado.edu>
5013 2001-12-27 Fernando Perez <fperez@colorado.edu>
5008
5014
5009 * IPython/iplib.py (InteractiveShell.interact): Added the original
5015 * IPython/iplib.py (InteractiveShell.interact): Added the original
5010 code from 'code.py' for this module in order to change the
5016 code from 'code.py' for this module in order to change the
5011 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5017 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5012 the history cache would break when the user hit Ctrl-C, and
5018 the history cache would break when the user hit Ctrl-C, and
5013 interact() offers no way to add any hooks to it.
5019 interact() offers no way to add any hooks to it.
5014
5020
5015 2001-12-23 Fernando Perez <fperez@colorado.edu>
5021 2001-12-23 Fernando Perez <fperez@colorado.edu>
5016
5022
5017 * setup.py: added check for 'MANIFEST' before trying to remove
5023 * setup.py: added check for 'MANIFEST' before trying to remove
5018 it. Thanks to Sean Reifschneider.
5024 it. Thanks to Sean Reifschneider.
5019
5025
5020 2001-12-22 Fernando Perez <fperez@colorado.edu>
5026 2001-12-22 Fernando Perez <fperez@colorado.edu>
5021
5027
5022 * Released 0.2.2.
5028 * Released 0.2.2.
5023
5029
5024 * Finished (reasonably) writing the manual. Later will add the
5030 * Finished (reasonably) writing the manual. Later will add the
5025 python-standard navigation stylesheets, but for the time being
5031 python-standard navigation stylesheets, but for the time being
5026 it's fairly complete. Distribution will include html and pdf
5032 it's fairly complete. Distribution will include html and pdf
5027 versions.
5033 versions.
5028
5034
5029 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5035 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5030 (MayaVi author).
5036 (MayaVi author).
5031
5037
5032 2001-12-21 Fernando Perez <fperez@colorado.edu>
5038 2001-12-21 Fernando Perez <fperez@colorado.edu>
5033
5039
5034 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5040 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5035 good public release, I think (with the manual and the distutils
5041 good public release, I think (with the manual and the distutils
5036 installer). The manual can use some work, but that can go
5042 installer). The manual can use some work, but that can go
5037 slowly. Otherwise I think it's quite nice for end users. Next
5043 slowly. Otherwise I think it's quite nice for end users. Next
5038 summer, rewrite the guts of it...
5044 summer, rewrite the guts of it...
5039
5045
5040 * Changed format of ipythonrc files to use whitespace as the
5046 * Changed format of ipythonrc files to use whitespace as the
5041 separator instead of an explicit '='. Cleaner.
5047 separator instead of an explicit '='. Cleaner.
5042
5048
5043 2001-12-20 Fernando Perez <fperez@colorado.edu>
5049 2001-12-20 Fernando Perez <fperez@colorado.edu>
5044
5050
5045 * Started a manual in LyX. For now it's just a quick merge of the
5051 * Started a manual in LyX. For now it's just a quick merge of the
5046 various internal docstrings and READMEs. Later it may grow into a
5052 various internal docstrings and READMEs. Later it may grow into a
5047 nice, full-blown manual.
5053 nice, full-blown manual.
5048
5054
5049 * Set up a distutils based installer. Installation should now be
5055 * Set up a distutils based installer. Installation should now be
5050 trivially simple for end-users.
5056 trivially simple for end-users.
5051
5057
5052 2001-12-11 Fernando Perez <fperez@colorado.edu>
5058 2001-12-11 Fernando Perez <fperez@colorado.edu>
5053
5059
5054 * Released 0.2.0. First public release, announced it at
5060 * Released 0.2.0. First public release, announced it at
5055 comp.lang.python. From now on, just bugfixes...
5061 comp.lang.python. From now on, just bugfixes...
5056
5062
5057 * Went through all the files, set copyright/license notices and
5063 * Went through all the files, set copyright/license notices and
5058 cleaned up things. Ready for release.
5064 cleaned up things. Ready for release.
5059
5065
5060 2001-12-10 Fernando Perez <fperez@colorado.edu>
5066 2001-12-10 Fernando Perez <fperez@colorado.edu>
5061
5067
5062 * Changed the first-time installer not to use tarfiles. It's more
5068 * Changed the first-time installer not to use tarfiles. It's more
5063 robust now and less unix-dependent. Also makes it easier for
5069 robust now and less unix-dependent. Also makes it easier for
5064 people to later upgrade versions.
5070 people to later upgrade versions.
5065
5071
5066 * Changed @exit to @abort to reflect the fact that it's pretty
5072 * Changed @exit to @abort to reflect the fact that it's pretty
5067 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5073 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5068 becomes significant only when IPyhton is embedded: in that case,
5074 becomes significant only when IPyhton is embedded: in that case,
5069 C-D closes IPython only, but @abort kills the enclosing program
5075 C-D closes IPython only, but @abort kills the enclosing program
5070 too (unless it had called IPython inside a try catching
5076 too (unless it had called IPython inside a try catching
5071 SystemExit).
5077 SystemExit).
5072
5078
5073 * Created Shell module which exposes the actuall IPython Shell
5079 * Created Shell module which exposes the actuall IPython Shell
5074 classes, currently the normal and the embeddable one. This at
5080 classes, currently the normal and the embeddable one. This at
5075 least offers a stable interface we won't need to change when
5081 least offers a stable interface we won't need to change when
5076 (later) the internals are rewritten. That rewrite will be confined
5082 (later) the internals are rewritten. That rewrite will be confined
5077 to iplib and ipmaker, but the Shell interface should remain as is.
5083 to iplib and ipmaker, but the Shell interface should remain as is.
5078
5084
5079 * Added embed module which offers an embeddable IPShell object,
5085 * Added embed module which offers an embeddable IPShell object,
5080 useful to fire up IPython *inside* a running program. Great for
5086 useful to fire up IPython *inside* a running program. Great for
5081 debugging or dynamical data analysis.
5087 debugging or dynamical data analysis.
5082
5088
5083 2001-12-08 Fernando Perez <fperez@colorado.edu>
5089 2001-12-08 Fernando Perez <fperez@colorado.edu>
5084
5090
5085 * Fixed small bug preventing seeing info from methods of defined
5091 * Fixed small bug preventing seeing info from methods of defined
5086 objects (incorrect namespace in _ofind()).
5092 objects (incorrect namespace in _ofind()).
5087
5093
5088 * Documentation cleanup. Moved the main usage docstrings to a
5094 * Documentation cleanup. Moved the main usage docstrings to a
5089 separate file, usage.py (cleaner to maintain, and hopefully in the
5095 separate file, usage.py (cleaner to maintain, and hopefully in the
5090 future some perlpod-like way of producing interactive, man and
5096 future some perlpod-like way of producing interactive, man and
5091 html docs out of it will be found).
5097 html docs out of it will be found).
5092
5098
5093 * Added @profile to see your profile at any time.
5099 * Added @profile to see your profile at any time.
5094
5100
5095 * Added @p as an alias for 'print'. It's especially convenient if
5101 * Added @p as an alias for 'print'. It's especially convenient if
5096 using automagic ('p x' prints x).
5102 using automagic ('p x' prints x).
5097
5103
5098 * Small cleanups and fixes after a pychecker run.
5104 * Small cleanups and fixes after a pychecker run.
5099
5105
5100 * Changed the @cd command to handle @cd - and @cd -<n> for
5106 * Changed the @cd command to handle @cd - and @cd -<n> for
5101 visiting any directory in _dh.
5107 visiting any directory in _dh.
5102
5108
5103 * Introduced _dh, a history of visited directories. @dhist prints
5109 * Introduced _dh, a history of visited directories. @dhist prints
5104 it out with numbers.
5110 it out with numbers.
5105
5111
5106 2001-12-07 Fernando Perez <fperez@colorado.edu>
5112 2001-12-07 Fernando Perez <fperez@colorado.edu>
5107
5113
5108 * Released 0.1.22
5114 * Released 0.1.22
5109
5115
5110 * Made initialization a bit more robust against invalid color
5116 * Made initialization a bit more robust against invalid color
5111 options in user input (exit, not traceback-crash).
5117 options in user input (exit, not traceback-crash).
5112
5118
5113 * Changed the bug crash reporter to write the report only in the
5119 * Changed the bug crash reporter to write the report only in the
5114 user's .ipython directory. That way IPython won't litter people's
5120 user's .ipython directory. That way IPython won't litter people's
5115 hard disks with crash files all over the place. Also print on
5121 hard disks with crash files all over the place. Also print on
5116 screen the necessary mail command.
5122 screen the necessary mail command.
5117
5123
5118 * With the new ultraTB, implemented LightBG color scheme for light
5124 * With the new ultraTB, implemented LightBG color scheme for light
5119 background terminals. A lot of people like white backgrounds, so I
5125 background terminals. A lot of people like white backgrounds, so I
5120 guess we should at least give them something readable.
5126 guess we should at least give them something readable.
5121
5127
5122 2001-12-06 Fernando Perez <fperez@colorado.edu>
5128 2001-12-06 Fernando Perez <fperez@colorado.edu>
5123
5129
5124 * Modified the structure of ultraTB. Now there's a proper class
5130 * Modified the structure of ultraTB. Now there's a proper class
5125 for tables of color schemes which allow adding schemes easily and
5131 for tables of color schemes which allow adding schemes easily and
5126 switching the active scheme without creating a new instance every
5132 switching the active scheme without creating a new instance every
5127 time (which was ridiculous). The syntax for creating new schemes
5133 time (which was ridiculous). The syntax for creating new schemes
5128 is also cleaner. I think ultraTB is finally done, with a clean
5134 is also cleaner. I think ultraTB is finally done, with a clean
5129 class structure. Names are also much cleaner (now there's proper
5135 class structure. Names are also much cleaner (now there's proper
5130 color tables, no need for every variable to also have 'color' in
5136 color tables, no need for every variable to also have 'color' in
5131 its name).
5137 its name).
5132
5138
5133 * Broke down genutils into separate files. Now genutils only
5139 * Broke down genutils into separate files. Now genutils only
5134 contains utility functions, and classes have been moved to their
5140 contains utility functions, and classes have been moved to their
5135 own files (they had enough independent functionality to warrant
5141 own files (they had enough independent functionality to warrant
5136 it): ConfigLoader, OutputTrap, Struct.
5142 it): ConfigLoader, OutputTrap, Struct.
5137
5143
5138 2001-12-05 Fernando Perez <fperez@colorado.edu>
5144 2001-12-05 Fernando Perez <fperez@colorado.edu>
5139
5145
5140 * IPython turns 21! Released version 0.1.21, as a candidate for
5146 * IPython turns 21! Released version 0.1.21, as a candidate for
5141 public consumption. If all goes well, release in a few days.
5147 public consumption. If all goes well, release in a few days.
5142
5148
5143 * Fixed path bug (files in Extensions/ directory wouldn't be found
5149 * Fixed path bug (files in Extensions/ directory wouldn't be found
5144 unless IPython/ was explicitly in sys.path).
5150 unless IPython/ was explicitly in sys.path).
5145
5151
5146 * Extended the FlexCompleter class as MagicCompleter to allow
5152 * Extended the FlexCompleter class as MagicCompleter to allow
5147 completion of @-starting lines.
5153 completion of @-starting lines.
5148
5154
5149 * Created __release__.py file as a central repository for release
5155 * Created __release__.py file as a central repository for release
5150 info that other files can read from.
5156 info that other files can read from.
5151
5157
5152 * Fixed small bug in logging: when logging was turned on in
5158 * Fixed small bug in logging: when logging was turned on in
5153 mid-session, old lines with special meanings (!@?) were being
5159 mid-session, old lines with special meanings (!@?) were being
5154 logged without the prepended comment, which is necessary since
5160 logged without the prepended comment, which is necessary since
5155 they are not truly valid python syntax. This should make session
5161 they are not truly valid python syntax. This should make session
5156 restores produce less errors.
5162 restores produce less errors.
5157
5163
5158 * The namespace cleanup forced me to make a FlexCompleter class
5164 * The namespace cleanup forced me to make a FlexCompleter class
5159 which is nothing but a ripoff of rlcompleter, but with selectable
5165 which is nothing but a ripoff of rlcompleter, but with selectable
5160 namespace (rlcompleter only works in __main__.__dict__). I'll try
5166 namespace (rlcompleter only works in __main__.__dict__). I'll try
5161 to submit a note to the authors to see if this change can be
5167 to submit a note to the authors to see if this change can be
5162 incorporated in future rlcompleter releases (Dec.6: done)
5168 incorporated in future rlcompleter releases (Dec.6: done)
5163
5169
5164 * More fixes to namespace handling. It was a mess! Now all
5170 * More fixes to namespace handling. It was a mess! Now all
5165 explicit references to __main__.__dict__ are gone (except when
5171 explicit references to __main__.__dict__ are gone (except when
5166 really needed) and everything is handled through the namespace
5172 really needed) and everything is handled through the namespace
5167 dicts in the IPython instance. We seem to be getting somewhere
5173 dicts in the IPython instance. We seem to be getting somewhere
5168 with this, finally...
5174 with this, finally...
5169
5175
5170 * Small documentation updates.
5176 * Small documentation updates.
5171
5177
5172 * Created the Extensions directory under IPython (with an
5178 * Created the Extensions directory under IPython (with an
5173 __init__.py). Put the PhysicalQ stuff there. This directory should
5179 __init__.py). Put the PhysicalQ stuff there. This directory should
5174 be used for all special-purpose extensions.
5180 be used for all special-purpose extensions.
5175
5181
5176 * File renaming:
5182 * File renaming:
5177 ipythonlib --> ipmaker
5183 ipythonlib --> ipmaker
5178 ipplib --> iplib
5184 ipplib --> iplib
5179 This makes a bit more sense in terms of what these files actually do.
5185 This makes a bit more sense in terms of what these files actually do.
5180
5186
5181 * Moved all the classes and functions in ipythonlib to ipplib, so
5187 * Moved all the classes and functions in ipythonlib to ipplib, so
5182 now ipythonlib only has make_IPython(). This will ease up its
5188 now ipythonlib only has make_IPython(). This will ease up its
5183 splitting in smaller functional chunks later.
5189 splitting in smaller functional chunks later.
5184
5190
5185 * Cleaned up (done, I think) output of @whos. Better column
5191 * Cleaned up (done, I think) output of @whos. Better column
5186 formatting, and now shows str(var) for as much as it can, which is
5192 formatting, and now shows str(var) for as much as it can, which is
5187 typically what one gets with a 'print var'.
5193 typically what one gets with a 'print var'.
5188
5194
5189 2001-12-04 Fernando Perez <fperez@colorado.edu>
5195 2001-12-04 Fernando Perez <fperez@colorado.edu>
5190
5196
5191 * Fixed namespace problems. Now builtin/IPyhton/user names get
5197 * Fixed namespace problems. Now builtin/IPyhton/user names get
5192 properly reported in their namespace. Internal namespace handling
5198 properly reported in their namespace. Internal namespace handling
5193 is finally getting decent (not perfect yet, but much better than
5199 is finally getting decent (not perfect yet, but much better than
5194 the ad-hoc mess we had).
5200 the ad-hoc mess we had).
5195
5201
5196 * Removed -exit option. If people just want to run a python
5202 * Removed -exit option. If people just want to run a python
5197 script, that's what the normal interpreter is for. Less
5203 script, that's what the normal interpreter is for. Less
5198 unnecessary options, less chances for bugs.
5204 unnecessary options, less chances for bugs.
5199
5205
5200 * Added a crash handler which generates a complete post-mortem if
5206 * Added a crash handler which generates a complete post-mortem if
5201 IPython crashes. This will help a lot in tracking bugs down the
5207 IPython crashes. This will help a lot in tracking bugs down the
5202 road.
5208 road.
5203
5209
5204 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5210 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5205 which were boud to functions being reassigned would bypass the
5211 which were boud to functions being reassigned would bypass the
5206 logger, breaking the sync of _il with the prompt counter. This
5212 logger, breaking the sync of _il with the prompt counter. This
5207 would then crash IPython later when a new line was logged.
5213 would then crash IPython later when a new line was logged.
5208
5214
5209 2001-12-02 Fernando Perez <fperez@colorado.edu>
5215 2001-12-02 Fernando Perez <fperez@colorado.edu>
5210
5216
5211 * Made IPython a package. This means people don't have to clutter
5217 * Made IPython a package. This means people don't have to clutter
5212 their sys.path with yet another directory. Changed the INSTALL
5218 their sys.path with yet another directory. Changed the INSTALL
5213 file accordingly.
5219 file accordingly.
5214
5220
5215 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5221 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5216 sorts its output (so @who shows it sorted) and @whos formats the
5222 sorts its output (so @who shows it sorted) and @whos formats the
5217 table according to the width of the first column. Nicer, easier to
5223 table according to the width of the first column. Nicer, easier to
5218 read. Todo: write a generic table_format() which takes a list of
5224 read. Todo: write a generic table_format() which takes a list of
5219 lists and prints it nicely formatted, with optional row/column
5225 lists and prints it nicely formatted, with optional row/column
5220 separators and proper padding and justification.
5226 separators and proper padding and justification.
5221
5227
5222 * Released 0.1.20
5228 * Released 0.1.20
5223
5229
5224 * Fixed bug in @log which would reverse the inputcache list (a
5230 * Fixed bug in @log which would reverse the inputcache list (a
5225 copy operation was missing).
5231 copy operation was missing).
5226
5232
5227 * Code cleanup. @config was changed to use page(). Better, since
5233 * Code cleanup. @config was changed to use page(). Better, since
5228 its output is always quite long.
5234 its output is always quite long.
5229
5235
5230 * Itpl is back as a dependency. I was having too many problems
5236 * Itpl is back as a dependency. I was having too many problems
5231 getting the parametric aliases to work reliably, and it's just
5237 getting the parametric aliases to work reliably, and it's just
5232 easier to code weird string operations with it than playing %()s
5238 easier to code weird string operations with it than playing %()s
5233 games. It's only ~6k, so I don't think it's too big a deal.
5239 games. It's only ~6k, so I don't think it's too big a deal.
5234
5240
5235 * Found (and fixed) a very nasty bug with history. !lines weren't
5241 * Found (and fixed) a very nasty bug with history. !lines weren't
5236 getting cached, and the out of sync caches would crash
5242 getting cached, and the out of sync caches would crash
5237 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5243 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5238 division of labor a bit better. Bug fixed, cleaner structure.
5244 division of labor a bit better. Bug fixed, cleaner structure.
5239
5245
5240 2001-12-01 Fernando Perez <fperez@colorado.edu>
5246 2001-12-01 Fernando Perez <fperez@colorado.edu>
5241
5247
5242 * Released 0.1.19
5248 * Released 0.1.19
5243
5249
5244 * Added option -n to @hist to prevent line number printing. Much
5250 * Added option -n to @hist to prevent line number printing. Much
5245 easier to copy/paste code this way.
5251 easier to copy/paste code this way.
5246
5252
5247 * Created global _il to hold the input list. Allows easy
5253 * Created global _il to hold the input list. Allows easy
5248 re-execution of blocks of code by slicing it (inspired by Janko's
5254 re-execution of blocks of code by slicing it (inspired by Janko's
5249 comment on 'macros').
5255 comment on 'macros').
5250
5256
5251 * Small fixes and doc updates.
5257 * Small fixes and doc updates.
5252
5258
5253 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5259 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5254 much too fragile with automagic. Handles properly multi-line
5260 much too fragile with automagic. Handles properly multi-line
5255 statements and takes parameters.
5261 statements and takes parameters.
5256
5262
5257 2001-11-30 Fernando Perez <fperez@colorado.edu>
5263 2001-11-30 Fernando Perez <fperez@colorado.edu>
5258
5264
5259 * Version 0.1.18 released.
5265 * Version 0.1.18 released.
5260
5266
5261 * Fixed nasty namespace bug in initial module imports.
5267 * Fixed nasty namespace bug in initial module imports.
5262
5268
5263 * Added copyright/license notes to all code files (except
5269 * Added copyright/license notes to all code files (except
5264 DPyGetOpt). For the time being, LGPL. That could change.
5270 DPyGetOpt). For the time being, LGPL. That could change.
5265
5271
5266 * Rewrote a much nicer README, updated INSTALL, cleaned up
5272 * Rewrote a much nicer README, updated INSTALL, cleaned up
5267 ipythonrc-* samples.
5273 ipythonrc-* samples.
5268
5274
5269 * Overall code/documentation cleanup. Basically ready for
5275 * Overall code/documentation cleanup. Basically ready for
5270 release. Only remaining thing: licence decision (LGPL?).
5276 release. Only remaining thing: licence decision (LGPL?).
5271
5277
5272 * Converted load_config to a class, ConfigLoader. Now recursion
5278 * Converted load_config to a class, ConfigLoader. Now recursion
5273 control is better organized. Doesn't include the same file twice.
5279 control is better organized. Doesn't include the same file twice.
5274
5280
5275 2001-11-29 Fernando Perez <fperez@colorado.edu>
5281 2001-11-29 Fernando Perez <fperez@colorado.edu>
5276
5282
5277 * Got input history working. Changed output history variables from
5283 * Got input history working. Changed output history variables from
5278 _p to _o so that _i is for input and _o for output. Just cleaner
5284 _p to _o so that _i is for input and _o for output. Just cleaner
5279 convention.
5285 convention.
5280
5286
5281 * Implemented parametric aliases. This pretty much allows the
5287 * Implemented parametric aliases. This pretty much allows the
5282 alias system to offer full-blown shell convenience, I think.
5288 alias system to offer full-blown shell convenience, I think.
5283
5289
5284 * Version 0.1.17 released, 0.1.18 opened.
5290 * Version 0.1.17 released, 0.1.18 opened.
5285
5291
5286 * dot_ipython/ipythonrc (alias): added documentation.
5292 * dot_ipython/ipythonrc (alias): added documentation.
5287 (xcolor): Fixed small bug (xcolors -> xcolor)
5293 (xcolor): Fixed small bug (xcolors -> xcolor)
5288
5294
5289 * Changed the alias system. Now alias is a magic command to define
5295 * Changed the alias system. Now alias is a magic command to define
5290 aliases just like the shell. Rationale: the builtin magics should
5296 aliases just like the shell. Rationale: the builtin magics should
5291 be there for things deeply connected to IPython's
5297 be there for things deeply connected to IPython's
5292 architecture. And this is a much lighter system for what I think
5298 architecture. And this is a much lighter system for what I think
5293 is the really important feature: allowing users to define quickly
5299 is the really important feature: allowing users to define quickly
5294 magics that will do shell things for them, so they can customize
5300 magics that will do shell things for them, so they can customize
5295 IPython easily to match their work habits. If someone is really
5301 IPython easily to match their work habits. If someone is really
5296 desperate to have another name for a builtin alias, they can
5302 desperate to have another name for a builtin alias, they can
5297 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5303 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5298 works.
5304 works.
5299
5305
5300 2001-11-28 Fernando Perez <fperez@colorado.edu>
5306 2001-11-28 Fernando Perez <fperez@colorado.edu>
5301
5307
5302 * Changed @file so that it opens the source file at the proper
5308 * Changed @file so that it opens the source file at the proper
5303 line. Since it uses less, if your EDITOR environment is
5309 line. Since it uses less, if your EDITOR environment is
5304 configured, typing v will immediately open your editor of choice
5310 configured, typing v will immediately open your editor of choice
5305 right at the line where the object is defined. Not as quick as
5311 right at the line where the object is defined. Not as quick as
5306 having a direct @edit command, but for all intents and purposes it
5312 having a direct @edit command, but for all intents and purposes it
5307 works. And I don't have to worry about writing @edit to deal with
5313 works. And I don't have to worry about writing @edit to deal with
5308 all the editors, less does that.
5314 all the editors, less does that.
5309
5315
5310 * Version 0.1.16 released, 0.1.17 opened.
5316 * Version 0.1.16 released, 0.1.17 opened.
5311
5317
5312 * Fixed some nasty bugs in the page/page_dumb combo that could
5318 * Fixed some nasty bugs in the page/page_dumb combo that could
5313 crash IPython.
5319 crash IPython.
5314
5320
5315 2001-11-27 Fernando Perez <fperez@colorado.edu>
5321 2001-11-27 Fernando Perez <fperez@colorado.edu>
5316
5322
5317 * Version 0.1.15 released, 0.1.16 opened.
5323 * Version 0.1.15 released, 0.1.16 opened.
5318
5324
5319 * Finally got ? and ?? to work for undefined things: now it's
5325 * Finally got ? and ?? to work for undefined things: now it's
5320 possible to type {}.get? and get information about the get method
5326 possible to type {}.get? and get information about the get method
5321 of dicts, or os.path? even if only os is defined (so technically
5327 of dicts, or os.path? even if only os is defined (so technically
5322 os.path isn't). Works at any level. For example, after import os,
5328 os.path isn't). Works at any level. For example, after import os,
5323 os?, os.path?, os.path.abspath? all work. This is great, took some
5329 os?, os.path?, os.path.abspath? all work. This is great, took some
5324 work in _ofind.
5330 work in _ofind.
5325
5331
5326 * Fixed more bugs with logging. The sanest way to do it was to add
5332 * Fixed more bugs with logging. The sanest way to do it was to add
5327 to @log a 'mode' parameter. Killed two in one shot (this mode
5333 to @log a 'mode' parameter. Killed two in one shot (this mode
5328 option was a request of Janko's). I think it's finally clean
5334 option was a request of Janko's). I think it's finally clean
5329 (famous last words).
5335 (famous last words).
5330
5336
5331 * Added a page_dumb() pager which does a decent job of paging on
5337 * Added a page_dumb() pager which does a decent job of paging on
5332 screen, if better things (like less) aren't available. One less
5338 screen, if better things (like less) aren't available. One less
5333 unix dependency (someday maybe somebody will port this to
5339 unix dependency (someday maybe somebody will port this to
5334 windows).
5340 windows).
5335
5341
5336 * Fixed problem in magic_log: would lock of logging out if log
5342 * Fixed problem in magic_log: would lock of logging out if log
5337 creation failed (because it would still think it had succeeded).
5343 creation failed (because it would still think it had succeeded).
5338
5344
5339 * Improved the page() function using curses to auto-detect screen
5345 * Improved the page() function using curses to auto-detect screen
5340 size. Now it can make a much better decision on whether to print
5346 size. Now it can make a much better decision on whether to print
5341 or page a string. Option screen_length was modified: a value 0
5347 or page a string. Option screen_length was modified: a value 0
5342 means auto-detect, and that's the default now.
5348 means auto-detect, and that's the default now.
5343
5349
5344 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5350 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5345 go out. I'll test it for a few days, then talk to Janko about
5351 go out. I'll test it for a few days, then talk to Janko about
5346 licences and announce it.
5352 licences and announce it.
5347
5353
5348 * Fixed the length of the auto-generated ---> prompt which appears
5354 * Fixed the length of the auto-generated ---> prompt which appears
5349 for auto-parens and auto-quotes. Getting this right isn't trivial,
5355 for auto-parens and auto-quotes. Getting this right isn't trivial,
5350 with all the color escapes, different prompt types and optional
5356 with all the color escapes, different prompt types and optional
5351 separators. But it seems to be working in all the combinations.
5357 separators. But it seems to be working in all the combinations.
5352
5358
5353 2001-11-26 Fernando Perez <fperez@colorado.edu>
5359 2001-11-26 Fernando Perez <fperez@colorado.edu>
5354
5360
5355 * Wrote a regexp filter to get option types from the option names
5361 * Wrote a regexp filter to get option types from the option names
5356 string. This eliminates the need to manually keep two duplicate
5362 string. This eliminates the need to manually keep two duplicate
5357 lists.
5363 lists.
5358
5364
5359 * Removed the unneeded check_option_names. Now options are handled
5365 * Removed the unneeded check_option_names. Now options are handled
5360 in a much saner manner and it's easy to visually check that things
5366 in a much saner manner and it's easy to visually check that things
5361 are ok.
5367 are ok.
5362
5368
5363 * Updated version numbers on all files I modified to carry a
5369 * Updated version numbers on all files I modified to carry a
5364 notice so Janko and Nathan have clear version markers.
5370 notice so Janko and Nathan have clear version markers.
5365
5371
5366 * Updated docstring for ultraTB with my changes. I should send
5372 * Updated docstring for ultraTB with my changes. I should send
5367 this to Nathan.
5373 this to Nathan.
5368
5374
5369 * Lots of small fixes. Ran everything through pychecker again.
5375 * Lots of small fixes. Ran everything through pychecker again.
5370
5376
5371 * Made loading of deep_reload an cmd line option. If it's not too
5377 * Made loading of deep_reload an cmd line option. If it's not too
5372 kosher, now people can just disable it. With -nodeep_reload it's
5378 kosher, now people can just disable it. With -nodeep_reload it's
5373 still available as dreload(), it just won't overwrite reload().
5379 still available as dreload(), it just won't overwrite reload().
5374
5380
5375 * Moved many options to the no| form (-opt and -noopt
5381 * Moved many options to the no| form (-opt and -noopt
5376 accepted). Cleaner.
5382 accepted). Cleaner.
5377
5383
5378 * Changed magic_log so that if called with no parameters, it uses
5384 * Changed magic_log so that if called with no parameters, it uses
5379 'rotate' mode. That way auto-generated logs aren't automatically
5385 'rotate' mode. That way auto-generated logs aren't automatically
5380 over-written. For normal logs, now a backup is made if it exists
5386 over-written. For normal logs, now a backup is made if it exists
5381 (only 1 level of backups). A new 'backup' mode was added to the
5387 (only 1 level of backups). A new 'backup' mode was added to the
5382 Logger class to support this. This was a request by Janko.
5388 Logger class to support this. This was a request by Janko.
5383
5389
5384 * Added @logoff/@logon to stop/restart an active log.
5390 * Added @logoff/@logon to stop/restart an active log.
5385
5391
5386 * Fixed a lot of bugs in log saving/replay. It was pretty
5392 * Fixed a lot of bugs in log saving/replay. It was pretty
5387 broken. Now special lines (!@,/) appear properly in the command
5393 broken. Now special lines (!@,/) appear properly in the command
5388 history after a log replay.
5394 history after a log replay.
5389
5395
5390 * Tried and failed to implement full session saving via pickle. My
5396 * Tried and failed to implement full session saving via pickle. My
5391 idea was to pickle __main__.__dict__, but modules can't be
5397 idea was to pickle __main__.__dict__, but modules can't be
5392 pickled. This would be a better alternative to replaying logs, but
5398 pickled. This would be a better alternative to replaying logs, but
5393 seems quite tricky to get to work. Changed -session to be called
5399 seems quite tricky to get to work. Changed -session to be called
5394 -logplay, which more accurately reflects what it does. And if we
5400 -logplay, which more accurately reflects what it does. And if we
5395 ever get real session saving working, -session is now available.
5401 ever get real session saving working, -session is now available.
5396
5402
5397 * Implemented color schemes for prompts also. As for tracebacks,
5403 * Implemented color schemes for prompts also. As for tracebacks,
5398 currently only NoColor and Linux are supported. But now the
5404 currently only NoColor and Linux are supported. But now the
5399 infrastructure is in place, based on a generic ColorScheme
5405 infrastructure is in place, based on a generic ColorScheme
5400 class. So writing and activating new schemes both for the prompts
5406 class. So writing and activating new schemes both for the prompts
5401 and the tracebacks should be straightforward.
5407 and the tracebacks should be straightforward.
5402
5408
5403 * Version 0.1.13 released, 0.1.14 opened.
5409 * Version 0.1.13 released, 0.1.14 opened.
5404
5410
5405 * Changed handling of options for output cache. Now counter is
5411 * Changed handling of options for output cache. Now counter is
5406 hardwired starting at 1 and one specifies the maximum number of
5412 hardwired starting at 1 and one specifies the maximum number of
5407 entries *in the outcache* (not the max prompt counter). This is
5413 entries *in the outcache* (not the max prompt counter). This is
5408 much better, since many statements won't increase the cache
5414 much better, since many statements won't increase the cache
5409 count. It also eliminated some confusing options, now there's only
5415 count. It also eliminated some confusing options, now there's only
5410 one: cache_size.
5416 one: cache_size.
5411
5417
5412 * Added 'alias' magic function and magic_alias option in the
5418 * Added 'alias' magic function and magic_alias option in the
5413 ipythonrc file. Now the user can easily define whatever names he
5419 ipythonrc file. Now the user can easily define whatever names he
5414 wants for the magic functions without having to play weird
5420 wants for the magic functions without having to play weird
5415 namespace games. This gives IPython a real shell-like feel.
5421 namespace games. This gives IPython a real shell-like feel.
5416
5422
5417 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5423 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5418 @ or not).
5424 @ or not).
5419
5425
5420 This was one of the last remaining 'visible' bugs (that I know
5426 This was one of the last remaining 'visible' bugs (that I know
5421 of). I think if I can clean up the session loading so it works
5427 of). I think if I can clean up the session loading so it works
5422 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5428 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5423 about licensing).
5429 about licensing).
5424
5430
5425 2001-11-25 Fernando Perez <fperez@colorado.edu>
5431 2001-11-25 Fernando Perez <fperez@colorado.edu>
5426
5432
5427 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5433 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5428 there's a cleaner distinction between what ? and ?? show.
5434 there's a cleaner distinction between what ? and ?? show.
5429
5435
5430 * Added screen_length option. Now the user can define his own
5436 * Added screen_length option. Now the user can define his own
5431 screen size for page() operations.
5437 screen size for page() operations.
5432
5438
5433 * Implemented magic shell-like functions with automatic code
5439 * Implemented magic shell-like functions with automatic code
5434 generation. Now adding another function is just a matter of adding
5440 generation. Now adding another function is just a matter of adding
5435 an entry to a dict, and the function is dynamically generated at
5441 an entry to a dict, and the function is dynamically generated at
5436 run-time. Python has some really cool features!
5442 run-time. Python has some really cool features!
5437
5443
5438 * Renamed many options to cleanup conventions a little. Now all
5444 * Renamed many options to cleanup conventions a little. Now all
5439 are lowercase, and only underscores where needed. Also in the code
5445 are lowercase, and only underscores where needed. Also in the code
5440 option name tables are clearer.
5446 option name tables are clearer.
5441
5447
5442 * Changed prompts a little. Now input is 'In [n]:' instead of
5448 * Changed prompts a little. Now input is 'In [n]:' instead of
5443 'In[n]:='. This allows it the numbers to be aligned with the
5449 'In[n]:='. This allows it the numbers to be aligned with the
5444 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5450 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5445 Python (it was a Mathematica thing). The '...' continuation prompt
5451 Python (it was a Mathematica thing). The '...' continuation prompt
5446 was also changed a little to align better.
5452 was also changed a little to align better.
5447
5453
5448 * Fixed bug when flushing output cache. Not all _p<n> variables
5454 * Fixed bug when flushing output cache. Not all _p<n> variables
5449 exist, so their deletion needs to be wrapped in a try:
5455 exist, so their deletion needs to be wrapped in a try:
5450
5456
5451 * Figured out how to properly use inspect.formatargspec() (it
5457 * Figured out how to properly use inspect.formatargspec() (it
5452 requires the args preceded by *). So I removed all the code from
5458 requires the args preceded by *). So I removed all the code from
5453 _get_pdef in Magic, which was just replicating that.
5459 _get_pdef in Magic, which was just replicating that.
5454
5460
5455 * Added test to prefilter to allow redefining magic function names
5461 * Added test to prefilter to allow redefining magic function names
5456 as variables. This is ok, since the @ form is always available,
5462 as variables. This is ok, since the @ form is always available,
5457 but whe should allow the user to define a variable called 'ls' if
5463 but whe should allow the user to define a variable called 'ls' if
5458 he needs it.
5464 he needs it.
5459
5465
5460 * Moved the ToDo information from README into a separate ToDo.
5466 * Moved the ToDo information from README into a separate ToDo.
5461
5467
5462 * General code cleanup and small bugfixes. I think it's close to a
5468 * General code cleanup and small bugfixes. I think it's close to a
5463 state where it can be released, obviously with a big 'beta'
5469 state where it can be released, obviously with a big 'beta'
5464 warning on it.
5470 warning on it.
5465
5471
5466 * Got the magic function split to work. Now all magics are defined
5472 * Got the magic function split to work. Now all magics are defined
5467 in a separate class. It just organizes things a bit, and now
5473 in a separate class. It just organizes things a bit, and now
5468 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5474 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5469 was too long).
5475 was too long).
5470
5476
5471 * Changed @clear to @reset to avoid potential confusions with
5477 * Changed @clear to @reset to avoid potential confusions with
5472 the shell command clear. Also renamed @cl to @clear, which does
5478 the shell command clear. Also renamed @cl to @clear, which does
5473 exactly what people expect it to from their shell experience.
5479 exactly what people expect it to from their shell experience.
5474
5480
5475 Added a check to the @reset command (since it's so
5481 Added a check to the @reset command (since it's so
5476 destructive, it's probably a good idea to ask for confirmation).
5482 destructive, it's probably a good idea to ask for confirmation).
5477 But now reset only works for full namespace resetting. Since the
5483 But now reset only works for full namespace resetting. Since the
5478 del keyword is already there for deleting a few specific
5484 del keyword is already there for deleting a few specific
5479 variables, I don't see the point of having a redundant magic
5485 variables, I don't see the point of having a redundant magic
5480 function for the same task.
5486 function for the same task.
5481
5487
5482 2001-11-24 Fernando Perez <fperez@colorado.edu>
5488 2001-11-24 Fernando Perez <fperez@colorado.edu>
5483
5489
5484 * Updated the builtin docs (esp. the ? ones).
5490 * Updated the builtin docs (esp. the ? ones).
5485
5491
5486 * Ran all the code through pychecker. Not terribly impressed with
5492 * Ran all the code through pychecker. Not terribly impressed with
5487 it: lots of spurious warnings and didn't really find anything of
5493 it: lots of spurious warnings and didn't really find anything of
5488 substance (just a few modules being imported and not used).
5494 substance (just a few modules being imported and not used).
5489
5495
5490 * Implemented the new ultraTB functionality into IPython. New
5496 * Implemented the new ultraTB functionality into IPython. New
5491 option: xcolors. This chooses color scheme. xmode now only selects
5497 option: xcolors. This chooses color scheme. xmode now only selects
5492 between Plain and Verbose. Better orthogonality.
5498 between Plain and Verbose. Better orthogonality.
5493
5499
5494 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5500 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5495 mode and color scheme for the exception handlers. Now it's
5501 mode and color scheme for the exception handlers. Now it's
5496 possible to have the verbose traceback with no coloring.
5502 possible to have the verbose traceback with no coloring.
5497
5503
5498 2001-11-23 Fernando Perez <fperez@colorado.edu>
5504 2001-11-23 Fernando Perez <fperez@colorado.edu>
5499
5505
5500 * Version 0.1.12 released, 0.1.13 opened.
5506 * Version 0.1.12 released, 0.1.13 opened.
5501
5507
5502 * Removed option to set auto-quote and auto-paren escapes by
5508 * Removed option to set auto-quote and auto-paren escapes by
5503 user. The chances of breaking valid syntax are just too high. If
5509 user. The chances of breaking valid syntax are just too high. If
5504 someone *really* wants, they can always dig into the code.
5510 someone *really* wants, they can always dig into the code.
5505
5511
5506 * Made prompt separators configurable.
5512 * Made prompt separators configurable.
5507
5513
5508 2001-11-22 Fernando Perez <fperez@colorado.edu>
5514 2001-11-22 Fernando Perez <fperez@colorado.edu>
5509
5515
5510 * Small bugfixes in many places.
5516 * Small bugfixes in many places.
5511
5517
5512 * Removed the MyCompleter class from ipplib. It seemed redundant
5518 * Removed the MyCompleter class from ipplib. It seemed redundant
5513 with the C-p,C-n history search functionality. Less code to
5519 with the C-p,C-n history search functionality. Less code to
5514 maintain.
5520 maintain.
5515
5521
5516 * Moved all the original ipython.py code into ipythonlib.py. Right
5522 * Moved all the original ipython.py code into ipythonlib.py. Right
5517 now it's just one big dump into a function called make_IPython, so
5523 now it's just one big dump into a function called make_IPython, so
5518 no real modularity has been gained. But at least it makes the
5524 no real modularity has been gained. But at least it makes the
5519 wrapper script tiny, and since ipythonlib is a module, it gets
5525 wrapper script tiny, and since ipythonlib is a module, it gets
5520 compiled and startup is much faster.
5526 compiled and startup is much faster.
5521
5527
5522 This is a reasobably 'deep' change, so we should test it for a
5528 This is a reasobably 'deep' change, so we should test it for a
5523 while without messing too much more with the code.
5529 while without messing too much more with the code.
5524
5530
5525 2001-11-21 Fernando Perez <fperez@colorado.edu>
5531 2001-11-21 Fernando Perez <fperez@colorado.edu>
5526
5532
5527 * Version 0.1.11 released, 0.1.12 opened for further work.
5533 * Version 0.1.11 released, 0.1.12 opened for further work.
5528
5534
5529 * Removed dependency on Itpl. It was only needed in one place. It
5535 * Removed dependency on Itpl. It was only needed in one place. It
5530 would be nice if this became part of python, though. It makes life
5536 would be nice if this became part of python, though. It makes life
5531 *a lot* easier in some cases.
5537 *a lot* easier in some cases.
5532
5538
5533 * Simplified the prefilter code a bit. Now all handlers are
5539 * Simplified the prefilter code a bit. Now all handlers are
5534 expected to explicitly return a value (at least a blank string).
5540 expected to explicitly return a value (at least a blank string).
5535
5541
5536 * Heavy edits in ipplib. Removed the help system altogether. Now
5542 * Heavy edits in ipplib. Removed the help system altogether. Now
5537 obj?/?? is used for inspecting objects, a magic @doc prints
5543 obj?/?? is used for inspecting objects, a magic @doc prints
5538 docstrings, and full-blown Python help is accessed via the 'help'
5544 docstrings, and full-blown Python help is accessed via the 'help'
5539 keyword. This cleans up a lot of code (less to maintain) and does
5545 keyword. This cleans up a lot of code (less to maintain) and does
5540 the job. Since 'help' is now a standard Python component, might as
5546 the job. Since 'help' is now a standard Python component, might as
5541 well use it and remove duplicate functionality.
5547 well use it and remove duplicate functionality.
5542
5548
5543 Also removed the option to use ipplib as a standalone program. By
5549 Also removed the option to use ipplib as a standalone program. By
5544 now it's too dependent on other parts of IPython to function alone.
5550 now it's too dependent on other parts of IPython to function alone.
5545
5551
5546 * Fixed bug in genutils.pager. It would crash if the pager was
5552 * Fixed bug in genutils.pager. It would crash if the pager was
5547 exited immediately after opening (broken pipe).
5553 exited immediately after opening (broken pipe).
5548
5554
5549 * Trimmed down the VerboseTB reporting a little. The header is
5555 * Trimmed down the VerboseTB reporting a little. The header is
5550 much shorter now and the repeated exception arguments at the end
5556 much shorter now and the repeated exception arguments at the end
5551 have been removed. For interactive use the old header seemed a bit
5557 have been removed. For interactive use the old header seemed a bit
5552 excessive.
5558 excessive.
5553
5559
5554 * Fixed small bug in output of @whos for variables with multi-word
5560 * Fixed small bug in output of @whos for variables with multi-word
5555 types (only first word was displayed).
5561 types (only first word was displayed).
5556
5562
5557 2001-11-17 Fernando Perez <fperez@colorado.edu>
5563 2001-11-17 Fernando Perez <fperez@colorado.edu>
5558
5564
5559 * Version 0.1.10 released, 0.1.11 opened for further work.
5565 * Version 0.1.10 released, 0.1.11 opened for further work.
5560
5566
5561 * Modified dirs and friends. dirs now *returns* the stack (not
5567 * Modified dirs and friends. dirs now *returns* the stack (not
5562 prints), so one can manipulate it as a variable. Convenient to
5568 prints), so one can manipulate it as a variable. Convenient to
5563 travel along many directories.
5569 travel along many directories.
5564
5570
5565 * Fixed bug in magic_pdef: would only work with functions with
5571 * Fixed bug in magic_pdef: would only work with functions with
5566 arguments with default values.
5572 arguments with default values.
5567
5573
5568 2001-11-14 Fernando Perez <fperez@colorado.edu>
5574 2001-11-14 Fernando Perez <fperez@colorado.edu>
5569
5575
5570 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5576 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5571 example with IPython. Various other minor fixes and cleanups.
5577 example with IPython. Various other minor fixes and cleanups.
5572
5578
5573 * Version 0.1.9 released, 0.1.10 opened for further work.
5579 * Version 0.1.9 released, 0.1.10 opened for further work.
5574
5580
5575 * Added sys.path to the list of directories searched in the
5581 * Added sys.path to the list of directories searched in the
5576 execfile= option. It used to be the current directory and the
5582 execfile= option. It used to be the current directory and the
5577 user's IPYTHONDIR only.
5583 user's IPYTHONDIR only.
5578
5584
5579 2001-11-13 Fernando Perez <fperez@colorado.edu>
5585 2001-11-13 Fernando Perez <fperez@colorado.edu>
5580
5586
5581 * Reinstated the raw_input/prefilter separation that Janko had
5587 * Reinstated the raw_input/prefilter separation that Janko had
5582 initially. This gives a more convenient setup for extending the
5588 initially. This gives a more convenient setup for extending the
5583 pre-processor from the outside: raw_input always gets a string,
5589 pre-processor from the outside: raw_input always gets a string,
5584 and prefilter has to process it. We can then redefine prefilter
5590 and prefilter has to process it. We can then redefine prefilter
5585 from the outside and implement extensions for special
5591 from the outside and implement extensions for special
5586 purposes.
5592 purposes.
5587
5593
5588 Today I got one for inputting PhysicalQuantity objects
5594 Today I got one for inputting PhysicalQuantity objects
5589 (from Scientific) without needing any function calls at
5595 (from Scientific) without needing any function calls at
5590 all. Extremely convenient, and it's all done as a user-level
5596 all. Extremely convenient, and it's all done as a user-level
5591 extension (no IPython code was touched). Now instead of:
5597 extension (no IPython code was touched). Now instead of:
5592 a = PhysicalQuantity(4.2,'m/s**2')
5598 a = PhysicalQuantity(4.2,'m/s**2')
5593 one can simply say
5599 one can simply say
5594 a = 4.2 m/s**2
5600 a = 4.2 m/s**2
5595 or even
5601 or even
5596 a = 4.2 m/s^2
5602 a = 4.2 m/s^2
5597
5603
5598 I use this, but it's also a proof of concept: IPython really is
5604 I use this, but it's also a proof of concept: IPython really is
5599 fully user-extensible, even at the level of the parsing of the
5605 fully user-extensible, even at the level of the parsing of the
5600 command line. It's not trivial, but it's perfectly doable.
5606 command line. It's not trivial, but it's perfectly doable.
5601
5607
5602 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5608 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5603 the problem of modules being loaded in the inverse order in which
5609 the problem of modules being loaded in the inverse order in which
5604 they were defined in
5610 they were defined in
5605
5611
5606 * Version 0.1.8 released, 0.1.9 opened for further work.
5612 * Version 0.1.8 released, 0.1.9 opened for further work.
5607
5613
5608 * Added magics pdef, source and file. They respectively show the
5614 * Added magics pdef, source and file. They respectively show the
5609 definition line ('prototype' in C), source code and full python
5615 definition line ('prototype' in C), source code and full python
5610 file for any callable object. The object inspector oinfo uses
5616 file for any callable object. The object inspector oinfo uses
5611 these to show the same information.
5617 these to show the same information.
5612
5618
5613 * Version 0.1.7 released, 0.1.8 opened for further work.
5619 * Version 0.1.7 released, 0.1.8 opened for further work.
5614
5620
5615 * Separated all the magic functions into a class called Magic. The
5621 * Separated all the magic functions into a class called Magic. The
5616 InteractiveShell class was becoming too big for Xemacs to handle
5622 InteractiveShell class was becoming too big for Xemacs to handle
5617 (de-indenting a line would lock it up for 10 seconds while it
5623 (de-indenting a line would lock it up for 10 seconds while it
5618 backtracked on the whole class!)
5624 backtracked on the whole class!)
5619
5625
5620 FIXME: didn't work. It can be done, but right now namespaces are
5626 FIXME: didn't work. It can be done, but right now namespaces are
5621 all messed up. Do it later (reverted it for now, so at least
5627 all messed up. Do it later (reverted it for now, so at least
5622 everything works as before).
5628 everything works as before).
5623
5629
5624 * Got the object introspection system (magic_oinfo) working! I
5630 * Got the object introspection system (magic_oinfo) working! I
5625 think this is pretty much ready for release to Janko, so he can
5631 think this is pretty much ready for release to Janko, so he can
5626 test it for a while and then announce it. Pretty much 100% of what
5632 test it for a while and then announce it. Pretty much 100% of what
5627 I wanted for the 'phase 1' release is ready. Happy, tired.
5633 I wanted for the 'phase 1' release is ready. Happy, tired.
5628
5634
5629 2001-11-12 Fernando Perez <fperez@colorado.edu>
5635 2001-11-12 Fernando Perez <fperez@colorado.edu>
5630
5636
5631 * Version 0.1.6 released, 0.1.7 opened for further work.
5637 * Version 0.1.6 released, 0.1.7 opened for further work.
5632
5638
5633 * Fixed bug in printing: it used to test for truth before
5639 * Fixed bug in printing: it used to test for truth before
5634 printing, so 0 wouldn't print. Now checks for None.
5640 printing, so 0 wouldn't print. Now checks for None.
5635
5641
5636 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5642 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5637 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5643 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5638 reaches by hand into the outputcache. Think of a better way to do
5644 reaches by hand into the outputcache. Think of a better way to do
5639 this later.
5645 this later.
5640
5646
5641 * Various small fixes thanks to Nathan's comments.
5647 * Various small fixes thanks to Nathan's comments.
5642
5648
5643 * Changed magic_pprint to magic_Pprint. This way it doesn't
5649 * Changed magic_pprint to magic_Pprint. This way it doesn't
5644 collide with pprint() and the name is consistent with the command
5650 collide with pprint() and the name is consistent with the command
5645 line option.
5651 line option.
5646
5652
5647 * Changed prompt counter behavior to be fully like
5653 * Changed prompt counter behavior to be fully like
5648 Mathematica's. That is, even input that doesn't return a result
5654 Mathematica's. That is, even input that doesn't return a result
5649 raises the prompt counter. The old behavior was kind of confusing
5655 raises the prompt counter. The old behavior was kind of confusing
5650 (getting the same prompt number several times if the operation
5656 (getting the same prompt number several times if the operation
5651 didn't return a result).
5657 didn't return a result).
5652
5658
5653 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5659 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5654
5660
5655 * Fixed -Classic mode (wasn't working anymore).
5661 * Fixed -Classic mode (wasn't working anymore).
5656
5662
5657 * Added colored prompts using Nathan's new code. Colors are
5663 * Added colored prompts using Nathan's new code. Colors are
5658 currently hardwired, they can be user-configurable. For
5664 currently hardwired, they can be user-configurable. For
5659 developers, they can be chosen in file ipythonlib.py, at the
5665 developers, they can be chosen in file ipythonlib.py, at the
5660 beginning of the CachedOutput class def.
5666 beginning of the CachedOutput class def.
5661
5667
5662 2001-11-11 Fernando Perez <fperez@colorado.edu>
5668 2001-11-11 Fernando Perez <fperez@colorado.edu>
5663
5669
5664 * Version 0.1.5 released, 0.1.6 opened for further work.
5670 * Version 0.1.5 released, 0.1.6 opened for further work.
5665
5671
5666 * Changed magic_env to *return* the environment as a dict (not to
5672 * Changed magic_env to *return* the environment as a dict (not to
5667 print it). This way it prints, but it can also be processed.
5673 print it). This way it prints, but it can also be processed.
5668
5674
5669 * Added Verbose exception reporting to interactive
5675 * Added Verbose exception reporting to interactive
5670 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5676 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5671 traceback. Had to make some changes to the ultraTB file. This is
5677 traceback. Had to make some changes to the ultraTB file. This is
5672 probably the last 'big' thing in my mental todo list. This ties
5678 probably the last 'big' thing in my mental todo list. This ties
5673 in with the next entry:
5679 in with the next entry:
5674
5680
5675 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5681 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5676 has to specify is Plain, Color or Verbose for all exception
5682 has to specify is Plain, Color or Verbose for all exception
5677 handling.
5683 handling.
5678
5684
5679 * Removed ShellServices option. All this can really be done via
5685 * Removed ShellServices option. All this can really be done via
5680 the magic system. It's easier to extend, cleaner and has automatic
5686 the magic system. It's easier to extend, cleaner and has automatic
5681 namespace protection and documentation.
5687 namespace protection and documentation.
5682
5688
5683 2001-11-09 Fernando Perez <fperez@colorado.edu>
5689 2001-11-09 Fernando Perez <fperez@colorado.edu>
5684
5690
5685 * Fixed bug in output cache flushing (missing parameter to
5691 * Fixed bug in output cache flushing (missing parameter to
5686 __init__). Other small bugs fixed (found using pychecker).
5692 __init__). Other small bugs fixed (found using pychecker).
5687
5693
5688 * Version 0.1.4 opened for bugfixing.
5694 * Version 0.1.4 opened for bugfixing.
5689
5695
5690 2001-11-07 Fernando Perez <fperez@colorado.edu>
5696 2001-11-07 Fernando Perez <fperez@colorado.edu>
5691
5697
5692 * Version 0.1.3 released, mainly because of the raw_input bug.
5698 * Version 0.1.3 released, mainly because of the raw_input bug.
5693
5699
5694 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5700 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5695 and when testing for whether things were callable, a call could
5701 and when testing for whether things were callable, a call could
5696 actually be made to certain functions. They would get called again
5702 actually be made to certain functions. They would get called again
5697 once 'really' executed, with a resulting double call. A disaster
5703 once 'really' executed, with a resulting double call. A disaster
5698 in many cases (list.reverse() would never work!).
5704 in many cases (list.reverse() would never work!).
5699
5705
5700 * Removed prefilter() function, moved its code to raw_input (which
5706 * Removed prefilter() function, moved its code to raw_input (which
5701 after all was just a near-empty caller for prefilter). This saves
5707 after all was just a near-empty caller for prefilter). This saves
5702 a function call on every prompt, and simplifies the class a tiny bit.
5708 a function call on every prompt, and simplifies the class a tiny bit.
5703
5709
5704 * Fix _ip to __ip name in magic example file.
5710 * Fix _ip to __ip name in magic example file.
5705
5711
5706 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5712 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5707 work with non-gnu versions of tar.
5713 work with non-gnu versions of tar.
5708
5714
5709 2001-11-06 Fernando Perez <fperez@colorado.edu>
5715 2001-11-06 Fernando Perez <fperez@colorado.edu>
5710
5716
5711 * Version 0.1.2. Just to keep track of the recent changes.
5717 * Version 0.1.2. Just to keep track of the recent changes.
5712
5718
5713 * Fixed nasty bug in output prompt routine. It used to check 'if
5719 * Fixed nasty bug in output prompt routine. It used to check 'if
5714 arg != None...'. Problem is, this fails if arg implements a
5720 arg != None...'. Problem is, this fails if arg implements a
5715 special comparison (__cmp__) which disallows comparing to
5721 special comparison (__cmp__) which disallows comparing to
5716 None. Found it when trying to use the PhysicalQuantity module from
5722 None. Found it when trying to use the PhysicalQuantity module from
5717 ScientificPython.
5723 ScientificPython.
5718
5724
5719 2001-11-05 Fernando Perez <fperez@colorado.edu>
5725 2001-11-05 Fernando Perez <fperez@colorado.edu>
5720
5726
5721 * Also added dirs. Now the pushd/popd/dirs family functions
5727 * Also added dirs. Now the pushd/popd/dirs family functions
5722 basically like the shell, with the added convenience of going home
5728 basically like the shell, with the added convenience of going home
5723 when called with no args.
5729 when called with no args.
5724
5730
5725 * pushd/popd slightly modified to mimic shell behavior more
5731 * pushd/popd slightly modified to mimic shell behavior more
5726 closely.
5732 closely.
5727
5733
5728 * Added env,pushd,popd from ShellServices as magic functions. I
5734 * Added env,pushd,popd from ShellServices as magic functions. I
5729 think the cleanest will be to port all desired functions from
5735 think the cleanest will be to port all desired functions from
5730 ShellServices as magics and remove ShellServices altogether. This
5736 ShellServices as magics and remove ShellServices altogether. This
5731 will provide a single, clean way of adding functionality
5737 will provide a single, clean way of adding functionality
5732 (shell-type or otherwise) to IP.
5738 (shell-type or otherwise) to IP.
5733
5739
5734 2001-11-04 Fernando Perez <fperez@colorado.edu>
5740 2001-11-04 Fernando Perez <fperez@colorado.edu>
5735
5741
5736 * Added .ipython/ directory to sys.path. This way users can keep
5742 * Added .ipython/ directory to sys.path. This way users can keep
5737 customizations there and access them via import.
5743 customizations there and access them via import.
5738
5744
5739 2001-11-03 Fernando Perez <fperez@colorado.edu>
5745 2001-11-03 Fernando Perez <fperez@colorado.edu>
5740
5746
5741 * Opened version 0.1.1 for new changes.
5747 * Opened version 0.1.1 for new changes.
5742
5748
5743 * Changed version number to 0.1.0: first 'public' release, sent to
5749 * Changed version number to 0.1.0: first 'public' release, sent to
5744 Nathan and Janko.
5750 Nathan and Janko.
5745
5751
5746 * Lots of small fixes and tweaks.
5752 * Lots of small fixes and tweaks.
5747
5753
5748 * Minor changes to whos format. Now strings are shown, snipped if
5754 * Minor changes to whos format. Now strings are shown, snipped if
5749 too long.
5755 too long.
5750
5756
5751 * Changed ShellServices to work on __main__ so they show up in @who
5757 * Changed ShellServices to work on __main__ so they show up in @who
5752
5758
5753 * Help also works with ? at the end of a line:
5759 * Help also works with ? at the end of a line:
5754 ?sin and sin?
5760 ?sin and sin?
5755 both produce the same effect. This is nice, as often I use the
5761 both produce the same effect. This is nice, as often I use the
5756 tab-complete to find the name of a method, but I used to then have
5762 tab-complete to find the name of a method, but I used to then have
5757 to go to the beginning of the line to put a ? if I wanted more
5763 to go to the beginning of the line to put a ? if I wanted more
5758 info. Now I can just add the ? and hit return. Convenient.
5764 info. Now I can just add the ? and hit return. Convenient.
5759
5765
5760 2001-11-02 Fernando Perez <fperez@colorado.edu>
5766 2001-11-02 Fernando Perez <fperez@colorado.edu>
5761
5767
5762 * Python version check (>=2.1) added.
5768 * Python version check (>=2.1) added.
5763
5769
5764 * Added LazyPython documentation. At this point the docs are quite
5770 * Added LazyPython documentation. At this point the docs are quite
5765 a mess. A cleanup is in order.
5771 a mess. A cleanup is in order.
5766
5772
5767 * Auto-installer created. For some bizarre reason, the zipfiles
5773 * Auto-installer created. For some bizarre reason, the zipfiles
5768 module isn't working on my system. So I made a tar version
5774 module isn't working on my system. So I made a tar version
5769 (hopefully the command line options in various systems won't kill
5775 (hopefully the command line options in various systems won't kill
5770 me).
5776 me).
5771
5777
5772 * Fixes to Struct in genutils. Now all dictionary-like methods are
5778 * Fixes to Struct in genutils. Now all dictionary-like methods are
5773 protected (reasonably).
5779 protected (reasonably).
5774
5780
5775 * Added pager function to genutils and changed ? to print usage
5781 * Added pager function to genutils and changed ? to print usage
5776 note through it (it was too long).
5782 note through it (it was too long).
5777
5783
5778 * Added the LazyPython functionality. Works great! I changed the
5784 * Added the LazyPython functionality. Works great! I changed the
5779 auto-quote escape to ';', it's on home row and next to '. But
5785 auto-quote escape to ';', it's on home row and next to '. But
5780 both auto-quote and auto-paren (still /) escapes are command-line
5786 both auto-quote and auto-paren (still /) escapes are command-line
5781 parameters.
5787 parameters.
5782
5788
5783
5789
5784 2001-11-01 Fernando Perez <fperez@colorado.edu>
5790 2001-11-01 Fernando Perez <fperez@colorado.edu>
5785
5791
5786 * Version changed to 0.0.7. Fairly large change: configuration now
5792 * Version changed to 0.0.7. Fairly large change: configuration now
5787 is all stored in a directory, by default .ipython. There, all
5793 is all stored in a directory, by default .ipython. There, all
5788 config files have normal looking names (not .names)
5794 config files have normal looking names (not .names)
5789
5795
5790 * Version 0.0.6 Released first to Lucas and Archie as a test
5796 * Version 0.0.6 Released first to Lucas and Archie as a test
5791 run. Since it's the first 'semi-public' release, change version to
5797 run. Since it's the first 'semi-public' release, change version to
5792 > 0.0.6 for any changes now.
5798 > 0.0.6 for any changes now.
5793
5799
5794 * Stuff I had put in the ipplib.py changelog:
5800 * Stuff I had put in the ipplib.py changelog:
5795
5801
5796 Changes to InteractiveShell:
5802 Changes to InteractiveShell:
5797
5803
5798 - Made the usage message a parameter.
5804 - Made the usage message a parameter.
5799
5805
5800 - Require the name of the shell variable to be given. It's a bit
5806 - Require the name of the shell variable to be given. It's a bit
5801 of a hack, but allows the name 'shell' not to be hardwired in the
5807 of a hack, but allows the name 'shell' not to be hardwired in the
5802 magic (@) handler, which is problematic b/c it requires
5808 magic (@) handler, which is problematic b/c it requires
5803 polluting the global namespace with 'shell'. This in turn is
5809 polluting the global namespace with 'shell'. This in turn is
5804 fragile: if a user redefines a variable called shell, things
5810 fragile: if a user redefines a variable called shell, things
5805 break.
5811 break.
5806
5812
5807 - magic @: all functions available through @ need to be defined
5813 - magic @: all functions available through @ need to be defined
5808 as magic_<name>, even though they can be called simply as
5814 as magic_<name>, even though they can be called simply as
5809 @<name>. This allows the special command @magic to gather
5815 @<name>. This allows the special command @magic to gather
5810 information automatically about all existing magic functions,
5816 information automatically about all existing magic functions,
5811 even if they are run-time user extensions, by parsing the shell
5817 even if they are run-time user extensions, by parsing the shell
5812 instance __dict__ looking for special magic_ names.
5818 instance __dict__ looking for special magic_ names.
5813
5819
5814 - mainloop: added *two* local namespace parameters. This allows
5820 - mainloop: added *two* local namespace parameters. This allows
5815 the class to differentiate between parameters which were there
5821 the class to differentiate between parameters which were there
5816 before and after command line initialization was processed. This
5822 before and after command line initialization was processed. This
5817 way, later @who can show things loaded at startup by the
5823 way, later @who can show things loaded at startup by the
5818 user. This trick was necessary to make session saving/reloading
5824 user. This trick was necessary to make session saving/reloading
5819 really work: ideally after saving/exiting/reloading a session,
5825 really work: ideally after saving/exiting/reloading a session,
5820 *everything* should look the same, including the output of @who. I
5826 *everything* should look the same, including the output of @who. I
5821 was only able to make this work with this double namespace
5827 was only able to make this work with this double namespace
5822 trick.
5828 trick.
5823
5829
5824 - added a header to the logfile which allows (almost) full
5830 - added a header to the logfile which allows (almost) full
5825 session restoring.
5831 session restoring.
5826
5832
5827 - prepend lines beginning with @ or !, with a and log
5833 - prepend lines beginning with @ or !, with a and log
5828 them. Why? !lines: may be useful to know what you did @lines:
5834 them. Why? !lines: may be useful to know what you did @lines:
5829 they may affect session state. So when restoring a session, at
5835 they may affect session state. So when restoring a session, at
5830 least inform the user of their presence. I couldn't quite get
5836 least inform the user of their presence. I couldn't quite get
5831 them to properly re-execute, but at least the user is warned.
5837 them to properly re-execute, but at least the user is warned.
5832
5838
5833 * Started ChangeLog.
5839 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now