##// END OF EJS Templates
- set the default value of autoedit_syntax to be false. Too many complaints....
fperez -
Show More
@@ -1,296 +1,285 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 1029 2006-01-18 07:33:38Z fperez $"""
18 $Id: Debugger.py 1324 2006-05-24 20:25:11Z fperez $"""
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
36 from IPython import Release
35 from IPython import Release
37 __author__ = '%s <%s>' % Release.authors['Fernando']
36 __author__ = '%s <%s>' % Release.authors['Fernando']
38 __license__ = 'Python'
37 __license__ = 'Python'
39
38
40 import bdb
39 import bdb
41 import cmd
40 import cmd
42 import linecache
41 import linecache
43 import os
42 import os
44 import pdb
43 import pdb
45 import sys
44 import sys
46
45
47 from IPython import PyColorize, ColorANSI
46 from IPython import PyColorize, ColorANSI
48 from IPython.genutils import Term
47 from IPython.genutils import Term
49 from IPython.excolors import ExceptionColors
48 from IPython.excolors import ExceptionColors
50
49
51 def _file_lines(fname):
50 def _file_lines(fname):
52 """Return the contents of a named file as a list of lines.
51 """Return the contents of a named file as a list of lines.
53
52
54 This function never raises an IOError exception: if the file can't be
53 This function never raises an IOError exception: if the file can't be
55 read, it simply returns an empty list."""
54 read, it simply returns an empty list."""
56
55
57 try:
56 try:
58 outfile = open(fname)
57 outfile = open(fname)
59 except IOError:
58 except IOError:
60 return []
59 return []
61 else:
60 else:
62 out = outfile.readlines()
61 out = outfile.readlines()
63 outfile.close()
62 outfile.close()
64 return out
63 return out
65
64
66
67 class Pdb(pdb.Pdb):
65 class Pdb(pdb.Pdb):
68 """Modified Pdb class, does not load readline."""
66 """Modified Pdb class, does not load readline."""
69
67
70 # Ugly hack: we can't call the parent constructor, because it binds
68 # Ugly hack: we can't call the parent constructor, because it binds
71 # readline and breaks tab-completion. This means we have to COPY the
69 # readline and breaks tab-completion. This means we have to COPY the
72 # constructor here, and that requires tracking various python versions.
70 # constructor here, and that requires tracking various python versions.
73
71
74 def __init__(self,color_scheme='NoColor'):
72 def __init__(self,color_scheme='NoColor'):
75 bdb.Bdb.__init__(self)
73 bdb.Bdb.__init__(self)
76 cmd.Cmd.__init__(self,completekey=None) # don't load readline
74 cmd.Cmd.__init__(self,completekey=None) # don't load readline
77 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
75 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
78 self.aliases = {}
76 self.aliases = {}
79
77
80 # These two lines are part of the py2.4 constructor, let's put them
78 # These two lines are part of the py2.4 constructor, let's put them
81 # unconditionally here as they won't cause any problems in 2.3.
79 # unconditionally here as they won't cause any problems in 2.3.
82 self.mainpyfile = ''
80 self.mainpyfile = ''
83 self._wait_for_mainpyfile = 0
81 self._wait_for_mainpyfile = 0
84
82
85 # Read $HOME/.pdbrc and ./.pdbrc
83 # Read $HOME/.pdbrc and ./.pdbrc
86 try:
84 try:
87 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
85 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
88 ".pdbrc"))
86 ".pdbrc"))
89 except KeyError:
87 except KeyError:
90 self.rcLines = []
88 self.rcLines = []
91 self.rcLines.extend(_file_lines(".pdbrc"))
89 self.rcLines.extend(_file_lines(".pdbrc"))
92
90
93 # Create color table: we copy the default one from the traceback
91 # Create color table: we copy the default one from the traceback
94 # module and add a few attributes needed for debugging
92 # module and add a few attributes needed for debugging
95 self.color_scheme_table = ExceptionColors.copy()
93 self.color_scheme_table = ExceptionColors.copy()
96
94
97 # shorthands
95 # shorthands
98 C = ColorANSI.TermColors
96 C = ColorANSI.TermColors
99 cst = self.color_scheme_table
97 cst = self.color_scheme_table
100
98
101 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
99 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
102 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
100 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
103
101
104 cst['Linux'].colors.breakpoint_enabled = C.LightRed
102 cst['Linux'].colors.breakpoint_enabled = C.LightRed
105 cst['Linux'].colors.breakpoint_disabled = C.Red
103 cst['Linux'].colors.breakpoint_disabled = C.Red
106
104
107 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
105 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
108 cst['LightBG'].colors.breakpoint_disabled = C.Red
106 cst['LightBG'].colors.breakpoint_disabled = C.Red
109
107
110 self.set_colors(color_scheme)
108 self.set_colors(color_scheme)
111
109
112 def set_colors(self, scheme):
110 def set_colors(self, scheme):
113 """Shorthand access to the color table scheme selector method."""
111 """Shorthand access to the color table scheme selector method."""
114 self.color_scheme_table.set_active_scheme(scheme)
112 self.color_scheme_table.set_active_scheme(scheme)
115
113
116
117 def interaction(self, frame, traceback):
114 def interaction(self, frame, traceback):
118 __IPYTHON__.set_completer_frame(frame)
115 __IPYTHON__.set_completer_frame(frame)
119 pdb.Pdb.interaction(self, frame, traceback)
116 pdb.Pdb.interaction(self, frame, traceback)
120
117
121
122 def do_up(self, arg):
118 def do_up(self, arg):
123 pdb.Pdb.do_up(self, arg)
119 pdb.Pdb.do_up(self, arg)
124 __IPYTHON__.set_completer_frame(self.curframe)
120 __IPYTHON__.set_completer_frame(self.curframe)
125 do_u = do_up
121 do_u = do_up
126
122
127
128 def do_down(self, arg):
123 def do_down(self, arg):
129 pdb.Pdb.do_down(self, arg)
124 pdb.Pdb.do_down(self, arg)
130 __IPYTHON__.set_completer_frame(self.curframe)
125 __IPYTHON__.set_completer_frame(self.curframe)
131 do_d = do_down
126 do_d = do_down
132
127
133
134 def postloop(self):
128 def postloop(self):
135 __IPYTHON__.set_completer_frame(None)
129 __IPYTHON__.set_completer_frame(None)
136
130
137
138 def print_stack_trace(self):
131 def print_stack_trace(self):
139 try:
132 try:
140 for frame_lineno in self.stack:
133 for frame_lineno in self.stack:
141 self.print_stack_entry(frame_lineno, context = 5)
134 self.print_stack_entry(frame_lineno, context = 5)
142 except KeyboardInterrupt:
135 except KeyboardInterrupt:
143 pass
136 pass
144
137
145
146 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
138 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
147 context = 3):
139 context = 3):
148 frame, lineno = frame_lineno
140 frame, lineno = frame_lineno
149 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
141 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
150
142
151
152 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
143 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
153 import linecache, repr
144 import linecache, repr
154
145
155 ret = ""
146 ret = []
156
147
157 Colors = self.color_scheme_table.active_colors
148 Colors = self.color_scheme_table.active_colors
158 ColorsNormal = Colors.Normal
149 ColorsNormal = Colors.Normal
159 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
150 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
160 tpl_call = 'in %s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
151 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
161 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
152 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
162 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
153 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
163 ColorsNormal)
154 ColorsNormal)
164
155
165 frame, lineno = frame_lineno
156 frame, lineno = frame_lineno
166
157
167 return_value = ''
158 return_value = ''
168 if '__return__' in frame.f_locals:
159 if '__return__' in frame.f_locals:
169 rv = frame.f_locals['__return__']
160 rv = frame.f_locals['__return__']
170 #return_value += '->'
161 #return_value += '->'
171 return_value += repr.repr(rv) + '\n'
162 return_value += repr.repr(rv) + '\n'
172 ret += return_value
163 ret.append(return_value)
173
164
174 #s = filename + '(' + `lineno` + ')'
165 #s = filename + '(' + `lineno` + ')'
175 filename = self.canonic(frame.f_code.co_filename)
166 filename = self.canonic(frame.f_code.co_filename)
176 link = tpl_link % filename
167 link = tpl_link % filename
177
168
178 if frame.f_code.co_name:
169 if frame.f_code.co_name:
179 func = frame.f_code.co_name
170 func = frame.f_code.co_name
180 else:
171 else:
181 func = "<lambda>"
172 func = "<lambda>"
182
173
183 call = ''
174 call = ''
184 if func != '?':
175 if func != '?':
185 if '__args__' in frame.f_locals:
176 if '__args__' in frame.f_locals:
186 args = repr.repr(frame.f_locals['__args__'])
177 args = repr.repr(frame.f_locals['__args__'])
187 else:
178 else:
188 args = '()'
179 args = '()'
189 call = tpl_call % (func, args)
180 call = tpl_call % (func, args)
190
181
191 level = '%s %s\n' % (link, call)
182 # The level info should be generated in the same format pdb uses, to
192 ret += level
183 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
184 ret.append('> %s(%s)%s\n' % (link,lineno,call))
193
185
194 start = lineno - 1 - context//2
186 start = lineno - 1 - context//2
195 lines = linecache.getlines(filename)
187 lines = linecache.getlines(filename)
196 start = max(start, 0)
188 start = max(start, 0)
197 start = min(start, len(lines) - context)
189 start = min(start, len(lines) - context)
198 lines = lines[start : start + context]
190 lines = lines[start : start + context]
199
191
200 for i in range(len(lines)):
192 for i,line in enumerate(lines):
201 line = lines[i]
193 show_arrow = (start + 1 + i == lineno)
202 if start + 1 + i == lineno:
194 ret.append(self.__format_line(tpl_line_em, filename,
203 ret += self.__format_line(tpl_line_em, filename, start + 1 + i, line, arrow = True)
195 start + 1 + i, line,
204 else:
196 arrow = show_arrow) )
205 ret += self.__format_line(tpl_line, filename, start + 1 + i, line, arrow = False)
206
207 return ret
208
197
198 return ''.join(ret)
209
199
210 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
200 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
211 bp_mark = ""
201 bp_mark = ""
212 bp_mark_color = ""
202 bp_mark_color = ""
213
203
214 bp = None
204 bp = None
215 if lineno in self.get_file_breaks(filename):
205 if lineno in self.get_file_breaks(filename):
216 bps = self.get_breaks(filename, lineno)
206 bps = self.get_breaks(filename, lineno)
217 bp = bps[-1]
207 bp = bps[-1]
218
208
219 if bp:
209 if bp:
220 Colors = self.color_scheme_table.active_colors
210 Colors = self.color_scheme_table.active_colors
221 bp_mark = str(bp.number)
211 bp_mark = str(bp.number)
222 bp_mark_color = Colors.breakpoint_enabled
212 bp_mark_color = Colors.breakpoint_enabled
223 if not bp.enabled:
213 if not bp.enabled:
224 bp_mark_color = Colors.breakpoint_disabled
214 bp_mark_color = Colors.breakpoint_disabled
225
215
226 numbers_width = 7
216 numbers_width = 7
227 if arrow:
217 if arrow:
228 # This is the line with the error
218 # This is the line with the error
229 pad = numbers_width - len(str(lineno)) - len(bp_mark)
219 pad = numbers_width - len(str(lineno)) - len(bp_mark)
230 if pad >= 3:
220 if pad >= 3:
231 marker = '-'*(pad-3) + '-> '
221 marker = '-'*(pad-3) + '-> '
232 elif pad == 2:
222 elif pad == 2:
233 marker = '> '
223 marker = '> '
234 elif pad == 1:
224 elif pad == 1:
235 marker = '>'
225 marker = '>'
236 else:
226 else:
237 marker = ''
227 marker = ''
238 num = '%s%s' % (marker, str(lineno))
228 num = '%s%s' % (marker, str(lineno))
239 line = tpl_line % (bp_mark_color + bp_mark, num, line)
229 line = tpl_line % (bp_mark_color + bp_mark, num, line)
240 else:
230 else:
241 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
231 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
242 line = tpl_line % (bp_mark_color + bp_mark, num, line)
232 line = tpl_line % (bp_mark_color + bp_mark, num, line)
243
233
244 return line
234 return line
245
235
246
247 def do_list(self, arg):
236 def do_list(self, arg):
248 self.lastcmd = 'list'
237 self.lastcmd = 'list'
249 last = None
238 last = None
250 if arg:
239 if arg:
251 try:
240 try:
252 x = eval(arg, {}, {})
241 x = eval(arg, {}, {})
253 if type(x) == type(()):
242 if type(x) == type(()):
254 first, last = x
243 first, last = x
255 first = int(first)
244 first = int(first)
256 last = int(last)
245 last = int(last)
257 if last < first:
246 if last < first:
258 # Assume it's a count
247 # Assume it's a count
259 last = first + last
248 last = first + last
260 else:
249 else:
261 first = max(1, int(x) - 5)
250 first = max(1, int(x) - 5)
262 except:
251 except:
263 print '*** Error in argument:', `arg`
252 print '*** Error in argument:', `arg`
264 return
253 return
265 elif self.lineno is None:
254 elif self.lineno is None:
266 first = max(1, self.curframe.f_lineno - 5)
255 first = max(1, self.curframe.f_lineno - 5)
267 else:
256 else:
268 first = self.lineno + 1
257 first = self.lineno + 1
269 if last is None:
258 if last is None:
270 last = first + 10
259 last = first + 10
271 filename = self.curframe.f_code.co_filename
260 filename = self.curframe.f_code.co_filename
272 try:
261 try:
273 Colors = self.color_scheme_table.active_colors
262 Colors = self.color_scheme_table.active_colors
274 ColorsNormal = Colors.Normal
263 ColorsNormal = Colors.Normal
275 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
264 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
276 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
265 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
277 src = []
266 src = []
278 for lineno in range(first, last+1):
267 for lineno in range(first, last+1):
279 line = linecache.getline(filename, lineno)
268 line = linecache.getline(filename, lineno)
280 if not line:
269 if not line:
281 break
270 break
282
271
283 if lineno == self.curframe.f_lineno:
272 if lineno == self.curframe.f_lineno:
284 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
273 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
285 else:
274 else:
286 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
275 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
287
276
288 src.append(line)
277 src.append(line)
289 self.lineno = lineno
278 self.lineno = lineno
290
279
291 print >>Term.cout, ''.join(src)
280 print >>Term.cout, ''.join(src)
292
281
293 except KeyboardInterrupt:
282 except KeyboardInterrupt:
294 pass
283 pass
295
284
296 do_l = do_list
285 do_l = do_list
@@ -1,31 +1,30 b''
1 """ User configuration file for IPython
1 """ User configuration file for IPython
2
2
3 This is a more flexible and safe way to configure ipython than *rc files
3 This is a more flexible and safe way to configure ipython than *rc files
4 (ipythonrc, ipythonrc-pysh etc.)
4 (ipythonrc, ipythonrc-pysh etc.)
5
5
6 This file is always imported on ipython startup. You can import the
6 This file is always imported on ipython startup. You can import the
7 ipython extensions you need here (see IPython/Extensions directory).
7 ipython extensions you need here (see IPython/Extensions directory).
8
8
9 Feel free to edit this file to customize your ipython experience.
9 Feel free to edit this file to customize your ipython experience.
10
10
11 Note that as such this file does nothing, for backwards compatibility.
11 Note that as such this file does nothing, for backwards compatibility.
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
13 you can do here.
13 you can do here.
14
14
15 """
15 """
16
16
17 # Most of your config files and extensions will probably start with this import
17 # Most of your config files and extensions will probably start with this import
18
18
19 import IPython.ipapi
19 import IPython.ipapi
20 ip = IPython.ipapi.get()
20 ip = IPython.ipapi.get()
21
21
22 # You probably want to uncomment this if you did %upgrade -nolegacy
22 # You probably want to uncomment this if you did %upgrade -nolegacy
23 # import ipy_defaults
23 # import ipy_defaults
24
24
25 def main():
25 def main():
26 o = ip.options
26 o = ip.options
27 # An example on how to set options
27 # An example on how to set options
28 #o.autocall = 1
28 #o.autocall = 1
29
29
30 main()
30 main()
31
@@ -1,597 +1,597 b''
1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
2 # $Id: ipythonrc 1155 2006-02-12 01:21:00Z fperez $
2 # $Id: ipythonrc 1324 2006-05-24 20:25:11Z fperez $
3
3
4 #***************************************************************************
4 #***************************************************************************
5 #
5 #
6 # Configuration file for IPython -- ipythonrc format
6 # Configuration file for IPython -- ipythonrc format
7 #
7 #
8 # The format of this file is simply one of 'key value' lines.
8 # The format of this file is simply one of 'key value' lines.
9 # Lines containing only whitespace at the beginning and then a # are ignored
9 # Lines containing only whitespace at the beginning and then a # are ignored
10 # as comments. But comments can NOT be put on lines with data.
10 # as comments. But comments can NOT be put on lines with data.
11
11
12 # The meaning and use of each key are explained below.
12 # The meaning and use of each key are explained below.
13
13
14 #---------------------------------------------------------------------------
14 #---------------------------------------------------------------------------
15 # Section: included files
15 # Section: included files
16
16
17 # Put one or more *config* files (with the syntax of this file) you want to
17 # Put one or more *config* files (with the syntax of this file) you want to
18 # include. For keys with a unique value the outermost file has precedence. For
18 # include. For keys with a unique value the outermost file has precedence. For
19 # keys with multiple values, they all get assembled into a list which then
19 # keys with multiple values, they all get assembled into a list which then
20 # gets loaded by IPython.
20 # gets loaded by IPython.
21
21
22 # In this file, all lists of things should simply be space-separated.
22 # In this file, all lists of things should simply be space-separated.
23
23
24 # This allows you to build hierarchies of files which recursively load
24 # This allows you to build hierarchies of files which recursively load
25 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
25 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
26 # should only keep here basic things you always want available. Then you can
26 # should only keep here basic things you always want available. Then you can
27 # include it in every other special-purpose config file you create.
27 # include it in every other special-purpose config file you create.
28 include
28 include
29
29
30 #---------------------------------------------------------------------------
30 #---------------------------------------------------------------------------
31 # Section: startup setup
31 # Section: startup setup
32
32
33 # These are mostly things which parallel a command line option of the same
33 # These are mostly things which parallel a command line option of the same
34 # name.
34 # name.
35
35
36 # Keys in this section should only appear once. If any key from this section
36 # Keys in this section should only appear once. If any key from this section
37 # is encountered more than once, the last value remains, all earlier ones get
37 # is encountered more than once, the last value remains, all earlier ones get
38 # discarded.
38 # discarded.
39
39
40
40
41 # Automatic calling of callable objects. If set to 1 or 2, callable objects
41 # Automatic calling of callable objects. If set to 1 or 2, callable objects
42 # are automatically called when invoked at the command line, even if you don't
42 # are automatically called when invoked at the command line, even if you don't
43 # type parentheses. IPython adds the parentheses for you. For example:
43 # type parentheses. IPython adds the parentheses for you. For example:
44
44
45 #In [1]: str 45
45 #In [1]: str 45
46 #------> str(45)
46 #------> str(45)
47 #Out[1]: '45'
47 #Out[1]: '45'
48
48
49 # IPython reprints your line with '---->' indicating that it added
49 # IPython reprints your line with '---->' indicating that it added
50 # parentheses. While this option is very convenient for interactive use, it
50 # parentheses. While this option is very convenient for interactive use, it
51 # may occasionally cause problems with objects which have side-effects if
51 # may occasionally cause problems with objects which have side-effects if
52 # called unexpectedly.
52 # called unexpectedly.
53
53
54 # The valid values for autocall are:
54 # The valid values for autocall are:
55
55
56 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
56 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
57
57
58 # autocall 1 -> active, but do not apply if there are no arguments on the line.
58 # autocall 1 -> active, but do not apply if there are no arguments on the line.
59
59
60 # In this mode, you get:
60 # In this mode, you get:
61
61
62 #In [1]: callable
62 #In [1]: callable
63 #Out[1]: <built-in function callable>
63 #Out[1]: <built-in function callable>
64
64
65 #In [2]: callable 'hello'
65 #In [2]: callable 'hello'
66 #------> callable('hello')
66 #------> callable('hello')
67 #Out[2]: False
67 #Out[2]: False
68
68
69 # 2 -> Active always. Even if no arguments are present, the callable object
69 # 2 -> Active always. Even if no arguments are present, the callable object
70 # is called:
70 # is called:
71
71
72 #In [4]: callable
72 #In [4]: callable
73 #------> callable()
73 #------> callable()
74
74
75 # Note that even with autocall off, you can still use '/' at the start of a
75 # Note that even with autocall off, you can still use '/' at the start of a
76 # line to treat the first argument on the command line as a function and add
76 # line to treat the first argument on the command line as a function and add
77 # parentheses to it:
77 # parentheses to it:
78
78
79 #In [8]: /str 43
79 #In [8]: /str 43
80 #------> str(43)
80 #------> str(43)
81 #Out[8]: '43'
81 #Out[8]: '43'
82
82
83 autocall 1
83 autocall 1
84
84
85 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
85 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
86 # source code (see the 'editor' variable below), it is possible that you save
86 # source code (see the 'editor' variable below), it is possible that you save
87 # a file with syntax errors in it. If this variable is true, IPython will ask
87 # a file with syntax errors in it. If this variable is true, IPython will ask
88 # you whether to re-open the editor immediately to correct such an error.
88 # you whether to re-open the editor immediately to correct such an error.
89
89
90 autoedit_syntax 1
90 autoedit_syntax 0
91
91
92 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
92 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
93 # line, while also un-indenting automatically after 'raise' or 'return'.
93 # line, while also un-indenting automatically after 'raise' or 'return'.
94
94
95 # This feature uses the readline library, so it will honor your ~/.inputrc
95 # This feature uses the readline library, so it will honor your ~/.inputrc
96 # configuration (or whatever file your INPUTRC variable points to). Adding
96 # configuration (or whatever file your INPUTRC variable points to). Adding
97 # the following lines to your .inputrc file can make indent/unindenting more
97 # the following lines to your .inputrc file can make indent/unindenting more
98 # convenient (M-i indents, M-u unindents):
98 # convenient (M-i indents, M-u unindents):
99
99
100 # $if Python
100 # $if Python
101 # "\M-i": " "
101 # "\M-i": " "
102 # "\M-u": "\d\d\d\d"
102 # "\M-u": "\d\d\d\d"
103 # $endif
103 # $endif
104
104
105 # The feature is potentially a bit dangerous, because it can cause problems
105 # The feature is potentially a bit dangerous, because it can cause problems
106 # with pasting of indented code (the pasted code gets re-indented on each
106 # with pasting of indented code (the pasted code gets re-indented on each
107 # line). But it's a huge time-saver when working interactively. The magic
107 # line). But it's a huge time-saver when working interactively. The magic
108 # function %autoindent allows you to toggle it on/off at runtime.
108 # function %autoindent allows you to toggle it on/off at runtime.
109
109
110 autoindent 1
110 autoindent 1
111
111
112 # Auto-magic. This gives you access to all the magic functions without having
112 # Auto-magic. This gives you access to all the magic functions without having
113 # to prepend them with an % sign. If you define a variable with the same name
113 # to prepend them with an % sign. If you define a variable with the same name
114 # as a magic function (say who=1), you will need to access the magic function
114 # as a magic function (say who=1), you will need to access the magic function
115 # with % (%who in this example). However, if later you delete your variable
115 # with % (%who in this example). However, if later you delete your variable
116 # (del who), you'll recover the automagic calling form.
116 # (del who), you'll recover the automagic calling form.
117
117
118 # Considering that many magic functions provide a lot of shell-like
118 # Considering that many magic functions provide a lot of shell-like
119 # functionality, automagic gives you something close to a full Python+system
119 # functionality, automagic gives you something close to a full Python+system
120 # shell environment (and you can extend it further if you want).
120 # shell environment (and you can extend it further if you want).
121
121
122 automagic 1
122 automagic 1
123
123
124 # Size of the output cache. After this many entries are stored, the cache will
124 # Size of the output cache. After this many entries are stored, the cache will
125 # get flushed. Depending on the size of your intermediate calculations, you
125 # get flushed. Depending on the size of your intermediate calculations, you
126 # may have memory problems if you make it too big, since keeping things in the
126 # may have memory problems if you make it too big, since keeping things in the
127 # cache prevents Python from reclaiming the memory for old results. Experiment
127 # cache prevents Python from reclaiming the memory for old results. Experiment
128 # with a value that works well for you.
128 # with a value that works well for you.
129
129
130 # If you choose cache_size 0 IPython will revert to python's regular >>>
130 # If you choose cache_size 0 IPython will revert to python's regular >>>
131 # unnumbered prompt. You will still have _, __ and ___ for your last three
131 # unnumbered prompt. You will still have _, __ and ___ for your last three
132 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
132 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
133 # you are running on a slow machine or with very limited memory, this may
133 # you are running on a slow machine or with very limited memory, this may
134 # help.
134 # help.
135
135
136 cache_size 1000
136 cache_size 1000
137
137
138 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
138 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
139 # but that's your choice! Classic 1 -> same as IPython -classic.
139 # but that's your choice! Classic 1 -> same as IPython -classic.
140 # Note that this is _not_ the normal python interpreter, it's simply
140 # Note that this is _not_ the normal python interpreter, it's simply
141 # IPython emulating most of the classic interpreter's behavior.
141 # IPython emulating most of the classic interpreter's behavior.
142 classic 0
142 classic 0
143
143
144 # colors - Coloring option for prompts and traceback printouts.
144 # colors - Coloring option for prompts and traceback printouts.
145
145
146 # Currently available schemes: NoColor, Linux, LightBG.
146 # Currently available schemes: NoColor, Linux, LightBG.
147
147
148 # This option allows coloring the prompts and traceback printouts. This
148 # This option allows coloring the prompts and traceback printouts. This
149 # requires a terminal which can properly handle color escape sequences. If you
149 # requires a terminal which can properly handle color escape sequences. If you
150 # are having problems with this, use the NoColor scheme (uses no color escapes
150 # are having problems with this, use the NoColor scheme (uses no color escapes
151 # at all).
151 # at all).
152
152
153 # The Linux option works well in linux console type environments: dark
153 # The Linux option works well in linux console type environments: dark
154 # background with light fonts.
154 # background with light fonts.
155
155
156 # LightBG is similar to Linux but swaps dark/light colors to be more readable
156 # LightBG is similar to Linux but swaps dark/light colors to be more readable
157 # in light background terminals.
157 # in light background terminals.
158
158
159 # keep uncommented only the one you want:
159 # keep uncommented only the one you want:
160 colors Linux
160 colors Linux
161 #colors LightBG
161 #colors LightBG
162 #colors NoColor
162 #colors NoColor
163
163
164 ########################
164 ########################
165 # Note to Windows users
165 # Note to Windows users
166 #
166 #
167 # Color and readline support is avaialble to Windows users via Gary Bishop's
167 # Color and readline support is avaialble to Windows users via Gary Bishop's
168 # readline library. You can find Gary's tools at
168 # readline library. You can find Gary's tools at
169 # http://sourceforge.net/projects/uncpythontools.
169 # http://sourceforge.net/projects/uncpythontools.
170 # Note that his readline module requires in turn the ctypes library, available
170 # Note that his readline module requires in turn the ctypes library, available
171 # at http://starship.python.net/crew/theller/ctypes.
171 # at http://starship.python.net/crew/theller/ctypes.
172 ########################
172 ########################
173
173
174 # color_info: IPython can display information about objects via a set of
174 # color_info: IPython can display information about objects via a set of
175 # functions, and optionally can use colors for this, syntax highlighting
175 # functions, and optionally can use colors for this, syntax highlighting
176 # source code and various other elements. This information is passed through a
176 # source code and various other elements. This information is passed through a
177 # pager (it defaults to 'less' if $PAGER is not set).
177 # pager (it defaults to 'less' if $PAGER is not set).
178
178
179 # If your pager has problems, try to setting it to properly handle escapes
179 # If your pager has problems, try to setting it to properly handle escapes
180 # (see the less manpage for detail), or disable this option. The magic
180 # (see the less manpage for detail), or disable this option. The magic
181 # function %color_info allows you to toggle this interactively for testing.
181 # function %color_info allows you to toggle this interactively for testing.
182
182
183 color_info 1
183 color_info 1
184
184
185 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
185 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
186 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
186 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
187 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
187 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
188 # any confirmation.
188 # any confirmation.
189
189
190 confirm_exit 1
190 confirm_exit 1
191
191
192 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
192 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
193 # still available as dreload() and appears as a builtin.
193 # still available as dreload() and appears as a builtin.
194
194
195 deep_reload 0
195 deep_reload 0
196
196
197 # Which editor to use with the %edit command. If you leave this at 0, IPython
197 # Which editor to use with the %edit command. If you leave this at 0, IPython
198 # will honor your EDITOR environment variable. Since this editor is invoked on
198 # will honor your EDITOR environment variable. Since this editor is invoked on
199 # the fly by ipython and is meant for editing small code snippets, you may
199 # the fly by ipython and is meant for editing small code snippets, you may
200 # want to use a small, lightweight editor here.
200 # want to use a small, lightweight editor here.
201
201
202 # For Emacs users, setting up your Emacs server properly as described in the
202 # For Emacs users, setting up your Emacs server properly as described in the
203 # manual is a good idea. An alternative is to use jed, a very light editor
203 # manual is a good idea. An alternative is to use jed, a very light editor
204 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
204 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
205
205
206 editor 0
206 editor 0
207
207
208 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
208 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
209 log 0
209 log 0
210
210
211 # Same as ipython -Logfile YourLogfileName.
211 # Same as ipython -Logfile YourLogfileName.
212 # Don't use with log 1 (use one or the other)
212 # Don't use with log 1 (use one or the other)
213 logfile ''
213 logfile ''
214
214
215 # banner 0 -> same as ipython -nobanner
215 # banner 0 -> same as ipython -nobanner
216 banner 1
216 banner 1
217
217
218 # messages 0 -> same as ipython -nomessages
218 # messages 0 -> same as ipython -nomessages
219 messages 1
219 messages 1
220
220
221 # Automatically call the pdb debugger after every uncaught exception. If you
221 # Automatically call the pdb debugger after every uncaught exception. If you
222 # are used to debugging using pdb, this puts you automatically inside of it
222 # are used to debugging using pdb, this puts you automatically inside of it
223 # after any call (either in IPython or in code called by it) which triggers an
223 # after any call (either in IPython or in code called by it) which triggers an
224 # exception which goes uncaught.
224 # exception which goes uncaught.
225 pdb 0
225 pdb 0
226
226
227 # Enable the pprint module for printing. pprint tends to give a more readable
227 # Enable the pprint module for printing. pprint tends to give a more readable
228 # display (than print) for complex nested data structures.
228 # display (than print) for complex nested data structures.
229 pprint 1
229 pprint 1
230
230
231 # Prompt strings
231 # Prompt strings
232
232
233 # Most bash-like escapes can be used to customize IPython's prompts, as well as
233 # Most bash-like escapes can be used to customize IPython's prompts, as well as
234 # a few additional ones which are IPython-specific. All valid prompt escapes
234 # a few additional ones which are IPython-specific. All valid prompt escapes
235 # are described in detail in the Customization section of the IPython HTML/PDF
235 # are described in detail in the Customization section of the IPython HTML/PDF
236 # manual.
236 # manual.
237
237
238 # Use \# to represent the current prompt number, and quote them to protect
238 # Use \# to represent the current prompt number, and quote them to protect
239 # spaces.
239 # spaces.
240 prompt_in1 'In [\#]: '
240 prompt_in1 'In [\#]: '
241
241
242 # \D is replaced by as many dots as there are digits in the
242 # \D is replaced by as many dots as there are digits in the
243 # current value of \#.
243 # current value of \#.
244 prompt_in2 ' .\D.: '
244 prompt_in2 ' .\D.: '
245
245
246 prompt_out 'Out[\#]: '
246 prompt_out 'Out[\#]: '
247
247
248 # Select whether to left-pad the output prompts to match the length of the
248 # Select whether to left-pad the output prompts to match the length of the
249 # input ones. This allows you for example to use a simple '>' as an output
249 # input ones. This allows you for example to use a simple '>' as an output
250 # prompt, and yet have the output line up with the input. If set to false,
250 # prompt, and yet have the output line up with the input. If set to false,
251 # the output prompts will be unpadded (flush left).
251 # the output prompts will be unpadded (flush left).
252 prompts_pad_left 1
252 prompts_pad_left 1
253
253
254 # quick 1 -> same as ipython -quick
254 # quick 1 -> same as ipython -quick
255 quick 0
255 quick 0
256
256
257 # Use the readline library (1) or not (0). Most users will want this on, but
257 # Use the readline library (1) or not (0). Most users will want this on, but
258 # if you experience strange problems with line management (mainly when using
258 # if you experience strange problems with line management (mainly when using
259 # IPython inside Emacs buffers) you may try disabling it. Not having it on
259 # IPython inside Emacs buffers) you may try disabling it. Not having it on
260 # prevents you from getting command history with the arrow keys, searching and
260 # prevents you from getting command history with the arrow keys, searching and
261 # name completion using TAB.
261 # name completion using TAB.
262
262
263 readline 1
263 readline 1
264
264
265 # Screen Length: number of lines of your screen. This is used to control
265 # Screen Length: number of lines of your screen. This is used to control
266 # printing of very long strings. Strings longer than this number of lines will
266 # printing of very long strings. Strings longer than this number of lines will
267 # be paged with the less command instead of directly printed.
267 # be paged with the less command instead of directly printed.
268
268
269 # The default value for this is 0, which means IPython will auto-detect your
269 # The default value for this is 0, which means IPython will auto-detect your
270 # screen size every time it needs to print. If for some reason this isn't
270 # screen size every time it needs to print. If for some reason this isn't
271 # working well (it needs curses support), specify it yourself. Otherwise don't
271 # working well (it needs curses support), specify it yourself. Otherwise don't
272 # change the default.
272 # change the default.
273
273
274 screen_length 0
274 screen_length 0
275
275
276 # Prompt separators for input and output.
276 # Prompt separators for input and output.
277 # Use \n for newline explicitly, without quotes.
277 # Use \n for newline explicitly, without quotes.
278 # Use 0 (like at the cmd line) to turn off a given separator.
278 # Use 0 (like at the cmd line) to turn off a given separator.
279
279
280 # The structure of prompt printing is:
280 # The structure of prompt printing is:
281 # (SeparateIn)Input....
281 # (SeparateIn)Input....
282 # (SeparateOut)Output...
282 # (SeparateOut)Output...
283 # (SeparateOut2), # that is, no newline is printed after Out2
283 # (SeparateOut2), # that is, no newline is printed after Out2
284 # By choosing these you can organize your output any way you want.
284 # By choosing these you can organize your output any way you want.
285
285
286 separate_in \n
286 separate_in \n
287 separate_out 0
287 separate_out 0
288 separate_out2 0
288 separate_out2 0
289
289
290 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
290 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
291 # Simply removes all input/output separators, overriding the choices above.
291 # Simply removes all input/output separators, overriding the choices above.
292 nosep 0
292 nosep 0
293
293
294 # Wildcard searches - IPython has a system for searching names using
294 # Wildcard searches - IPython has a system for searching names using
295 # shell-like wildcards; type %psearch? for details. This variables sets
295 # shell-like wildcards; type %psearch? for details. This variables sets
296 # whether by default such searches should be case sensitive or not. You can
296 # whether by default such searches should be case sensitive or not. You can
297 # always override the default at the system command line or the IPython
297 # always override the default at the system command line or the IPython
298 # prompt.
298 # prompt.
299
299
300 wildcards_case_sensitive 1
300 wildcards_case_sensitive 1
301
301
302 # xmode - Exception reporting mode.
302 # xmode - Exception reporting mode.
303
303
304 # Valid modes: Plain, Context and Verbose.
304 # Valid modes: Plain, Context and Verbose.
305
305
306 # Plain: similar to python's normal traceback printing.
306 # Plain: similar to python's normal traceback printing.
307
307
308 # Context: prints 5 lines of context source code around each line in the
308 # Context: prints 5 lines of context source code around each line in the
309 # traceback.
309 # traceback.
310
310
311 # Verbose: similar to Context, but additionally prints the variables currently
311 # Verbose: similar to Context, but additionally prints the variables currently
312 # visible where the exception happened (shortening their strings if too
312 # visible where the exception happened (shortening their strings if too
313 # long). This can potentially be very slow, if you happen to have a huge data
313 # long). This can potentially be very slow, if you happen to have a huge data
314 # structure whose string representation is complex to compute. Your computer
314 # structure whose string representation is complex to compute. Your computer
315 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
315 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
316 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
316 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
317
317
318 #xmode Plain
318 #xmode Plain
319 xmode Context
319 xmode Context
320 #xmode Verbose
320 #xmode Verbose
321
321
322 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
322 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
323 # !cmd) to be used in multi-line input (like for loops). For example, if you
323 # !cmd) to be used in multi-line input (like for loops). For example, if you
324 # have this active, the following is valid in IPython:
324 # have this active, the following is valid in IPython:
325 #
325 #
326 #In [17]: for i in range(3):
326 #In [17]: for i in range(3):
327 # ....: mkdir $i
327 # ....: mkdir $i
328 # ....: !touch $i/hello
328 # ....: !touch $i/hello
329 # ....: ls -l $i
329 # ....: ls -l $i
330
330
331 multi_line_specials 1
331 multi_line_specials 1
332
332
333 # wxversion: request a specific wxPython version (used for -wthread)
333 # wxversion: request a specific wxPython version (used for -wthread)
334
334
335 # Set this to the value of wxPython you want to use, but note that this
335 # Set this to the value of wxPython you want to use, but note that this
336 # feature requires you to have the wxversion Python module to work. If you
336 # feature requires you to have the wxversion Python module to work. If you
337 # don't have the wxversion module (try 'import wxversion' at the prompt to
337 # don't have the wxversion module (try 'import wxversion' at the prompt to
338 # check) or simply want to leave the system to pick up the default, leave this
338 # check) or simply want to leave the system to pick up the default, leave this
339 # variable at 0.
339 # variable at 0.
340
340
341 wxversion 0
341 wxversion 0
342
342
343 #---------------------------------------------------------------------------
343 #---------------------------------------------------------------------------
344 # Section: Readline configuration (readline is not available for MS-Windows)
344 # Section: Readline configuration (readline is not available for MS-Windows)
345
345
346 # This is done via the following options:
346 # This is done via the following options:
347
347
348 # (i) readline_parse_and_bind: this option can appear as many times as you
348 # (i) readline_parse_and_bind: this option can appear as many times as you
349 # want, each time defining a string to be executed via a
349 # want, each time defining a string to be executed via a
350 # readline.parse_and_bind() command. The syntax for valid commands of this
350 # readline.parse_and_bind() command. The syntax for valid commands of this
351 # kind can be found by reading the documentation for the GNU readline library,
351 # kind can be found by reading the documentation for the GNU readline library,
352 # as these commands are of the kind which readline accepts in its
352 # as these commands are of the kind which readline accepts in its
353 # configuration file.
353 # configuration file.
354
354
355 # The TAB key can be used to complete names at the command line in one of two
355 # The TAB key can be used to complete names at the command line in one of two
356 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
356 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
357 # completes as much as possible while 'menu-complete' cycles through all
357 # completes as much as possible while 'menu-complete' cycles through all
358 # possible completions. Leave the one you prefer uncommented.
358 # possible completions. Leave the one you prefer uncommented.
359
359
360 readline_parse_and_bind tab: complete
360 readline_parse_and_bind tab: complete
361 #readline_parse_and_bind tab: menu-complete
361 #readline_parse_and_bind tab: menu-complete
362
362
363 # This binds Control-l to printing the list of all possible completions when
363 # This binds Control-l to printing the list of all possible completions when
364 # there is more than one (what 'complete' does when hitting TAB twice, or at
364 # there is more than one (what 'complete' does when hitting TAB twice, or at
365 # the first TAB if show-all-if-ambiguous is on)
365 # the first TAB if show-all-if-ambiguous is on)
366 readline_parse_and_bind "\C-l": possible-completions
366 readline_parse_and_bind "\C-l": possible-completions
367
367
368 # This forces readline to automatically print the above list when tab
368 # This forces readline to automatically print the above list when tab
369 # completion is set to 'complete'. You can still get this list manually by
369 # completion is set to 'complete'. You can still get this list manually by
370 # using the key bound to 'possible-completions' (Control-l by default) or by
370 # using the key bound to 'possible-completions' (Control-l by default) or by
371 # hitting TAB twice. Turning this on makes the printing happen at the first
371 # hitting TAB twice. Turning this on makes the printing happen at the first
372 # TAB.
372 # TAB.
373 readline_parse_and_bind set show-all-if-ambiguous on
373 readline_parse_and_bind set show-all-if-ambiguous on
374
374
375 # If you have TAB set to complete names, you can rebind any key (Control-o by
375 # If you have TAB set to complete names, you can rebind any key (Control-o by
376 # default) to insert a true TAB character.
376 # default) to insert a true TAB character.
377 readline_parse_and_bind "\C-o": tab-insert
377 readline_parse_and_bind "\C-o": tab-insert
378
378
379 # These commands allow you to indent/unindent easily, with the 4-space
379 # These commands allow you to indent/unindent easily, with the 4-space
380 # convention of the Python coding standards. Since IPython's internal
380 # convention of the Python coding standards. Since IPython's internal
381 # auto-indent system also uses 4 spaces, you should not change the number of
381 # auto-indent system also uses 4 spaces, you should not change the number of
382 # spaces in the code below.
382 # spaces in the code below.
383 readline_parse_and_bind "\M-i": " "
383 readline_parse_and_bind "\M-i": " "
384 readline_parse_and_bind "\M-o": "\d\d\d\d"
384 readline_parse_and_bind "\M-o": "\d\d\d\d"
385 readline_parse_and_bind "\M-I": "\d\d\d\d"
385 readline_parse_and_bind "\M-I": "\d\d\d\d"
386
386
387 # Bindings for incremental searches in the history. These searches use the
387 # Bindings for incremental searches in the history. These searches use the
388 # string typed so far on the command line and search anything in the previous
388 # string typed so far on the command line and search anything in the previous
389 # input history containing them.
389 # input history containing them.
390 readline_parse_and_bind "\C-r": reverse-search-history
390 readline_parse_and_bind "\C-r": reverse-search-history
391 readline_parse_and_bind "\C-s": forward-search-history
391 readline_parse_and_bind "\C-s": forward-search-history
392
392
393 # Bindings for completing the current line in the history of previous
393 # Bindings for completing the current line in the history of previous
394 # commands. This allows you to recall any previous command by typing its first
394 # commands. This allows you to recall any previous command by typing its first
395 # few letters and hitting Control-p, bypassing all intermediate commands which
395 # few letters and hitting Control-p, bypassing all intermediate commands which
396 # may be in the history (much faster than hitting up-arrow 50 times!)
396 # may be in the history (much faster than hitting up-arrow 50 times!)
397 readline_parse_and_bind "\C-p": history-search-backward
397 readline_parse_and_bind "\C-p": history-search-backward
398 readline_parse_and_bind "\C-n": history-search-forward
398 readline_parse_and_bind "\C-n": history-search-forward
399
399
400 # I also like to have the same functionality on the plain arrow keys. If you'd
400 # I also like to have the same functionality on the plain arrow keys. If you'd
401 # rather have the arrows use all the history (and not just match what you've
401 # rather have the arrows use all the history (and not just match what you've
402 # typed so far), comment out or delete the next two lines.
402 # typed so far), comment out or delete the next two lines.
403 readline_parse_and_bind "\e[A": history-search-backward
403 readline_parse_and_bind "\e[A": history-search-backward
404 readline_parse_and_bind "\e[B": history-search-forward
404 readline_parse_and_bind "\e[B": history-search-forward
405
405
406 # These are typically on by default under *nix, but not win32.
406 # These are typically on by default under *nix, but not win32.
407 readline_parse_and_bind "\C-k": kill-line
407 readline_parse_and_bind "\C-k": kill-line
408 readline_parse_and_bind "\C-u": unix-line-discard
408 readline_parse_and_bind "\C-u": unix-line-discard
409
409
410 # (ii) readline_remove_delims: a string of characters to be removed from the
410 # (ii) readline_remove_delims: a string of characters to be removed from the
411 # default word-delimiters list used by readline, so that completions may be
411 # default word-delimiters list used by readline, so that completions may be
412 # performed on strings which contain them.
412 # performed on strings which contain them.
413
413
414 readline_remove_delims -/~
414 readline_remove_delims -/~
415
415
416 # (iii) readline_merge_completions: whether to merge the result of all
416 # (iii) readline_merge_completions: whether to merge the result of all
417 # possible completions or not. If true, IPython will complete filenames,
417 # possible completions or not. If true, IPython will complete filenames,
418 # python names and aliases and return all possible completions. If you set it
418 # python names and aliases and return all possible completions. If you set it
419 # to false, each completer is used at a time, and only if it doesn't return
419 # to false, each completer is used at a time, and only if it doesn't return
420 # any completions is the next one used.
420 # any completions is the next one used.
421
421
422 # The default order is: [python_matches, file_matches, alias_matches]
422 # The default order is: [python_matches, file_matches, alias_matches]
423
423
424 readline_merge_completions 1
424 readline_merge_completions 1
425
425
426 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
426 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
427 # will complete all attributes of an object, including all the special methods
427 # will complete all attributes of an object, including all the special methods
428 # whose names start with single or double underscores (like __getitem__ or
428 # whose names start with single or double underscores (like __getitem__ or
429 # __class__).
429 # __class__).
430
430
431 # This variable allows you to control this completion behavior:
431 # This variable allows you to control this completion behavior:
432
432
433 # readline_omit__names 1 -> completion will omit showing any names starting
433 # readline_omit__names 1 -> completion will omit showing any names starting
434 # with two __, but it will still show names starting with one _.
434 # with two __, but it will still show names starting with one _.
435
435
436 # readline_omit__names 2 -> completion will omit all names beginning with one
436 # readline_omit__names 2 -> completion will omit all names beginning with one
437 # _ (which obviously means filtering out the double __ ones).
437 # _ (which obviously means filtering out the double __ ones).
438
438
439 # Even when this option is set, you can still see those names by explicitly
439 # Even when this option is set, you can still see those names by explicitly
440 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
440 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
441 # complete attribute names starting with '_'.
441 # complete attribute names starting with '_'.
442
442
443 # This option is off by default so that new users see all attributes of any
443 # This option is off by default so that new users see all attributes of any
444 # objects they are dealing with.
444 # objects they are dealing with.
445
445
446 readline_omit__names 0
446 readline_omit__names 0
447
447
448 #---------------------------------------------------------------------------
448 #---------------------------------------------------------------------------
449 # Section: modules to be loaded with 'import ...'
449 # Section: modules to be loaded with 'import ...'
450
450
451 # List, separated by spaces, the names of the modules you want to import
451 # List, separated by spaces, the names of the modules you want to import
452
452
453 # Example:
453 # Example:
454 # import_mod sys os
454 # import_mod sys os
455 # will produce internally the statements
455 # will produce internally the statements
456 # import sys
456 # import sys
457 # import os
457 # import os
458
458
459 # Each import is executed in its own try/except block, so if one module
459 # Each import is executed in its own try/except block, so if one module
460 # fails to load the others will still be ok.
460 # fails to load the others will still be ok.
461
461
462 import_mod
462 import_mod
463
463
464 #---------------------------------------------------------------------------
464 #---------------------------------------------------------------------------
465 # Section: modules to import some functions from: 'from ... import ...'
465 # Section: modules to import some functions from: 'from ... import ...'
466
466
467 # List, one per line, the modules for which you want only to import some
467 # List, one per line, the modules for which you want only to import some
468 # functions. Give the module name first and then the name of functions to be
468 # functions. Give the module name first and then the name of functions to be
469 # imported from that module.
469 # imported from that module.
470
470
471 # Example:
471 # Example:
472
472
473 # import_some IPython.genutils timing timings
473 # import_some IPython.genutils timing timings
474 # will produce internally the statement
474 # will produce internally the statement
475 # from IPython.genutils import timing, timings
475 # from IPython.genutils import timing, timings
476
476
477 # timing() and timings() are two IPython utilities for timing the execution of
477 # timing() and timings() are two IPython utilities for timing the execution of
478 # your own functions, which you may find useful. Just commment out the above
478 # your own functions, which you may find useful. Just commment out the above
479 # line if you want to test them.
479 # line if you want to test them.
480
480
481 # If you have more than one modules_some line, each gets its own try/except
481 # If you have more than one modules_some line, each gets its own try/except
482 # block (like modules, see above).
482 # block (like modules, see above).
483
483
484 import_some
484 import_some
485
485
486 #---------------------------------------------------------------------------
486 #---------------------------------------------------------------------------
487 # Section: modules to import all from : 'from ... import *'
487 # Section: modules to import all from : 'from ... import *'
488
488
489 # List (same syntax as import_mod above) those modules for which you want to
489 # List (same syntax as import_mod above) those modules for which you want to
490 # import all functions. Remember, this is a potentially dangerous thing to do,
490 # import all functions. Remember, this is a potentially dangerous thing to do,
491 # since it is very easy to overwrite names of things you need. Use with
491 # since it is very easy to overwrite names of things you need. Use with
492 # caution.
492 # caution.
493
493
494 # Example:
494 # Example:
495 # import_all sys os
495 # import_all sys os
496 # will produce internally the statements
496 # will produce internally the statements
497 # from sys import *
497 # from sys import *
498 # from os import *
498 # from os import *
499
499
500 # As before, each will be called in a separate try/except block.
500 # As before, each will be called in a separate try/except block.
501
501
502 import_all
502 import_all
503
503
504 #---------------------------------------------------------------------------
504 #---------------------------------------------------------------------------
505 # Section: Python code to execute.
505 # Section: Python code to execute.
506
506
507 # Put here code to be explicitly executed (keep it simple!)
507 # Put here code to be explicitly executed (keep it simple!)
508 # Put one line of python code per line. All whitespace is removed (this is a
508 # Put one line of python code per line. All whitespace is removed (this is a
509 # feature, not a bug), so don't get fancy building loops here.
509 # feature, not a bug), so don't get fancy building loops here.
510 # This is just for quick convenient creation of things you want available.
510 # This is just for quick convenient creation of things you want available.
511
511
512 # Example:
512 # Example:
513 # execute x = 1
513 # execute x = 1
514 # execute print 'hello world'; y = z = 'a'
514 # execute print 'hello world'; y = z = 'a'
515 # will produce internally
515 # will produce internally
516 # x = 1
516 # x = 1
517 # print 'hello world'; y = z = 'a'
517 # print 'hello world'; y = z = 'a'
518 # and each *line* (not each statement, we don't do python syntax parsing) is
518 # and each *line* (not each statement, we don't do python syntax parsing) is
519 # executed in its own try/except block.
519 # executed in its own try/except block.
520
520
521 execute
521 execute
522
522
523 # Note for the adventurous: you can use this to define your own names for the
523 # Note for the adventurous: you can use this to define your own names for the
524 # magic functions, by playing some namespace tricks:
524 # magic functions, by playing some namespace tricks:
525
525
526 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
526 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
527
527
528 # defines %pf as a new name for %profile.
528 # defines %pf as a new name for %profile.
529
529
530 #---------------------------------------------------------------------------
530 #---------------------------------------------------------------------------
531 # Section: Pyhton files to load and execute.
531 # Section: Pyhton files to load and execute.
532
532
533 # Put here the full names of files you want executed with execfile(file). If
533 # Put here the full names of files you want executed with execfile(file). If
534 # you want complicated initialization, just write whatever you want in a
534 # you want complicated initialization, just write whatever you want in a
535 # regular python file and load it from here.
535 # regular python file and load it from here.
536
536
537 # Filenames defined here (which *must* include the extension) are searched for
537 # Filenames defined here (which *must* include the extension) are searched for
538 # through all of sys.path. Since IPython adds your .ipython directory to
538 # through all of sys.path. Since IPython adds your .ipython directory to
539 # sys.path, they can also be placed in your .ipython dir and will be
539 # sys.path, they can also be placed in your .ipython dir and will be
540 # found. Otherwise (if you want to execute things not in .ipyton nor in
540 # found. Otherwise (if you want to execute things not in .ipyton nor in
541 # sys.path) give a full path (you can use ~, it gets expanded)
541 # sys.path) give a full path (you can use ~, it gets expanded)
542
542
543 # Example:
543 # Example:
544 # execfile file1.py ~/file2.py
544 # execfile file1.py ~/file2.py
545 # will generate
545 # will generate
546 # execfile('file1.py')
546 # execfile('file1.py')
547 # execfile('_path_to_your_home/file2.py')
547 # execfile('_path_to_your_home/file2.py')
548
548
549 # As before, each file gets its own try/except block.
549 # As before, each file gets its own try/except block.
550
550
551 execfile
551 execfile
552
552
553 # If you are feeling adventurous, you can even add functionality to IPython
553 # If you are feeling adventurous, you can even add functionality to IPython
554 # through here. IPython works through a global variable called __ip which
554 # through here. IPython works through a global variable called __ip which
555 # exists at the time when these files are read. If you know what you are doing
555 # exists at the time when these files are read. If you know what you are doing
556 # (read the source) you can add functions to __ip in files loaded here.
556 # (read the source) you can add functions to __ip in files loaded here.
557
557
558 # The file example-magic.py contains a simple but correct example. Try it:
558 # The file example-magic.py contains a simple but correct example. Try it:
559
559
560 # execfile example-magic.py
560 # execfile example-magic.py
561
561
562 # Look at the examples in IPython/iplib.py for more details on how these magic
562 # Look at the examples in IPython/iplib.py for more details on how these magic
563 # functions need to process their arguments.
563 # functions need to process their arguments.
564
564
565 #---------------------------------------------------------------------------
565 #---------------------------------------------------------------------------
566 # Section: aliases for system shell commands
566 # Section: aliases for system shell commands
567
567
568 # Here you can define your own names for system commands. The syntax is
568 # Here you can define your own names for system commands. The syntax is
569 # similar to that of the builtin %alias function:
569 # similar to that of the builtin %alias function:
570
570
571 # alias alias_name command_string
571 # alias alias_name command_string
572
572
573 # The resulting aliases are auto-generated magic functions (hence usable as
573 # The resulting aliases are auto-generated magic functions (hence usable as
574 # %alias_name)
574 # %alias_name)
575
575
576 # For example:
576 # For example:
577
577
578 # alias myls ls -la
578 # alias myls ls -la
579
579
580 # will define 'myls' as an alias for executing the system command 'ls -la'.
580 # will define 'myls' as an alias for executing the system command 'ls -la'.
581 # This allows you to customize IPython's environment to have the same aliases
581 # This allows you to customize IPython's environment to have the same aliases
582 # you are accustomed to from your own shell.
582 # you are accustomed to from your own shell.
583
583
584 # You can also define aliases with parameters using %s specifiers (one per
584 # You can also define aliases with parameters using %s specifiers (one per
585 # parameter):
585 # parameter):
586
586
587 # alias parts echo first %s second %s
587 # alias parts echo first %s second %s
588
588
589 # will give you in IPython:
589 # will give you in IPython:
590 # >>> %parts A B
590 # >>> %parts A B
591 # first A second B
591 # first A second B
592
592
593 # Use one 'alias' statement per alias you wish to define.
593 # Use one 'alias' statement per alias you wish to define.
594
594
595 # alias
595 # alias
596
596
597 #************************* end of file <ipythonrc> ************************
597 #************************* end of file <ipythonrc> ************************
@@ -1,750 +1,750 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.1 or better.
5 Requires Python 2.1 or better.
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 1260 2006-04-11 10:19:34Z vivainio $"""
9 $Id: ipmaker.py 1324 2006-05-24 20:25:11Z fperez $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
13 #
13 #
14 # Distributed under the terms of the BSD License. The full license is in
14 # Distributed under the terms of the BSD License. The full license is in
15 # the file COPYING, distributed as part of this software.
15 # the file COPYING, distributed as part of this software.
16 #*****************************************************************************
16 #*****************************************************************************
17
17
18 from IPython import Release
18 from IPython import Release
19 __author__ = '%s <%s>' % Release.authors['Fernando']
19 __author__ = '%s <%s>' % Release.authors['Fernando']
20 __license__ = Release.license
20 __license__ = Release.license
21 __version__ = Release.version
21 __version__ = Release.version
22
22
23 credits._Printer__data = """
23 credits._Printer__data = """
24 Python: %s
24 Python: %s
25
25
26 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
26 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
27 See http://ipython.scipy.org for more information.""" \
27 See http://ipython.scipy.org for more information.""" \
28 % credits._Printer__data
28 % credits._Printer__data
29
29
30 copyright._Printer__data += """
30 copyright._Printer__data += """
31
31
32 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
32 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
33 All Rights Reserved."""
33 All Rights Reserved."""
34
34
35 #****************************************************************************
35 #****************************************************************************
36 # Required modules
36 # Required modules
37
37
38 # From the standard library
38 # From the standard library
39 import __main__
39 import __main__
40 import __builtin__
40 import __builtin__
41 import os
41 import os
42 import re
42 import re
43 import sys
43 import sys
44 import types
44 import types
45 from pprint import pprint,pformat
45 from pprint import pprint,pformat
46
46
47 # Our own
47 # Our own
48 from IPython import DPyGetOpt
48 from IPython import DPyGetOpt
49 from IPython.ipstruct import Struct
49 from IPython.ipstruct import Struct
50 from IPython.OutputTrap import OutputTrap
50 from IPython.OutputTrap import OutputTrap
51 from IPython.ConfigLoader import ConfigLoader
51 from IPython.ConfigLoader import ConfigLoader
52 from IPython.iplib import InteractiveShell
52 from IPython.iplib import InteractiveShell
53 from IPython.usage import cmd_line_usage,interactive_usage
53 from IPython.usage import cmd_line_usage,interactive_usage
54 from IPython.genutils import *
54 from IPython.genutils import *
55
55
56 #-----------------------------------------------------------------------------
56 #-----------------------------------------------------------------------------
57 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
57 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
58 rc_override=None,shell_class=InteractiveShell,
58 rc_override=None,shell_class=InteractiveShell,
59 embedded=False,**kw):
59 embedded=False,**kw):
60 """This is a dump of IPython into a single function.
60 """This is a dump of IPython into a single function.
61
61
62 Later it will have to be broken up in a sensible manner.
62 Later it will have to be broken up in a sensible manner.
63
63
64 Arguments:
64 Arguments:
65
65
66 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
66 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
67 script name, b/c DPyGetOpt strips the first argument only for the real
67 script name, b/c DPyGetOpt strips the first argument only for the real
68 sys.argv.
68 sys.argv.
69
69
70 - user_ns: a dict to be used as the user's namespace."""
70 - user_ns: a dict to be used as the user's namespace."""
71
71
72 #----------------------------------------------------------------------
72 #----------------------------------------------------------------------
73 # Defaults and initialization
73 # Defaults and initialization
74
74
75 # For developer debugging, deactivates crash handler and uses pdb.
75 # For developer debugging, deactivates crash handler and uses pdb.
76 DEVDEBUG = False
76 DEVDEBUG = False
77
77
78 if argv is None:
78 if argv is None:
79 argv = sys.argv
79 argv = sys.argv
80
80
81 # __IP is the main global that lives throughout and represents the whole
81 # __IP is the main global that lives throughout and represents the whole
82 # application. If the user redefines it, all bets are off as to what
82 # application. If the user redefines it, all bets are off as to what
83 # happens.
83 # happens.
84
84
85 # __IP is the name of he global which the caller will have accessible as
85 # __IP is the name of he global which the caller will have accessible as
86 # __IP.name. We set its name via the first parameter passed to
86 # __IP.name. We set its name via the first parameter passed to
87 # InteractiveShell:
87 # InteractiveShell:
88
88
89 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
89 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
90 embedded=embedded,**kw)
90 embedded=embedded,**kw)
91
91
92 # Put 'help' in the user namespace
92 # Put 'help' in the user namespace
93 from site import _Helper
93 from site import _Helper
94 IP.user_ns['help'] = _Helper()
94 IP.user_ns['help'] = _Helper()
95
95
96
96
97 if DEVDEBUG:
97 if DEVDEBUG:
98 # For developer debugging only (global flag)
98 # For developer debugging only (global flag)
99 from IPython import ultraTB
99 from IPython import ultraTB
100 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
100 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
101
101
102 IP.BANNER_PARTS = ['Python %s\n'
102 IP.BANNER_PARTS = ['Python %s\n'
103 'Type "copyright", "credits" or "license" '
103 'Type "copyright", "credits" or "license" '
104 'for more information.\n'
104 'for more information.\n'
105 % (sys.version.split('\n')[0],),
105 % (sys.version.split('\n')[0],),
106 "IPython %s -- An enhanced Interactive Python."
106 "IPython %s -- An enhanced Interactive Python."
107 % (__version__,),
107 % (__version__,),
108 """? -> Introduction to IPython's features.
108 """? -> Introduction to IPython's features.
109 %magic -> Information about IPython's 'magic' % functions.
109 %magic -> Information about IPython's 'magic' % functions.
110 help -> Python's own help system.
110 help -> Python's own help system.
111 object? -> Details about 'object'. ?object also works, ?? prints more.
111 object? -> Details about 'object'. ?object also works, ?? prints more.
112 """ ]
112 """ ]
113
113
114 IP.usage = interactive_usage
114 IP.usage = interactive_usage
115
115
116 # Platform-dependent suffix and directory names. We use _ipython instead
116 # Platform-dependent suffix and directory names. We use _ipython instead
117 # of .ipython under win32 b/c there's software that breaks with .named
117 # of .ipython under win32 b/c there's software that breaks with .named
118 # directories on that platform.
118 # directories on that platform.
119 if os.name == 'posix':
119 if os.name == 'posix':
120 rc_suffix = ''
120 rc_suffix = ''
121 ipdir_def = '.ipython'
121 ipdir_def = '.ipython'
122 else:
122 else:
123 rc_suffix = '.ini'
123 rc_suffix = '.ini'
124 ipdir_def = '_ipython'
124 ipdir_def = '_ipython'
125
125
126 # default directory for configuration
126 # default directory for configuration
127 ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR',
127 ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR',
128 os.path.join(IP.home_dir,ipdir_def)))
128 os.path.join(IP.home_dir,ipdir_def)))
129
129
130 # add personal .ipython dir to sys.path so that users can put things in
130 # add personal .ipython dir to sys.path so that users can put things in
131 # there for customization
131 # there for customization
132 sys.path.append(ipythondir)
132 sys.path.append(ipythondir)
133
133
134 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
134 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
135
135
136 # we need the directory where IPython itself is installed
136 # we need the directory where IPython itself is installed
137 import IPython
137 import IPython
138 IPython_dir = os.path.dirname(IPython.__file__)
138 IPython_dir = os.path.dirname(IPython.__file__)
139 del IPython
139 del IPython
140
140
141 #-------------------------------------------------------------------------
141 #-------------------------------------------------------------------------
142 # Command line handling
142 # Command line handling
143
143
144 # Valid command line options (uses DPyGetOpt syntax, like Perl's
144 # Valid command line options (uses DPyGetOpt syntax, like Perl's
145 # GetOpt::Long)
145 # GetOpt::Long)
146
146
147 # Any key not listed here gets deleted even if in the file (like session
147 # Any key not listed here gets deleted even if in the file (like session
148 # or profile). That's deliberate, to maintain the rc namespace clean.
148 # or profile). That's deliberate, to maintain the rc namespace clean.
149
149
150 # Each set of options appears twice: under _conv only the names are
150 # Each set of options appears twice: under _conv only the names are
151 # listed, indicating which type they must be converted to when reading the
151 # listed, indicating which type they must be converted to when reading the
152 # ipythonrc file. And under DPyGetOpt they are listed with the regular
152 # ipythonrc file. And under DPyGetOpt they are listed with the regular
153 # DPyGetOpt syntax (=s,=i,:f,etc).
153 # DPyGetOpt syntax (=s,=i,:f,etc).
154
154
155 # Make sure there's a space before each end of line (they get auto-joined!)
155 # Make sure there's a space before each end of line (they get auto-joined!)
156 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
156 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
157 'c=s classic|cl color_info! colors=s confirm_exit! '
157 'c=s classic|cl color_info! colors=s confirm_exit! '
158 'debug! deep_reload! editor=s log|l messages! nosep pdb! '
158 'debug! deep_reload! editor=s log|l messages! nosep pdb! '
159 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
159 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
160 'quick screen_length|sl=i prompts_pad_left=i '
160 'quick screen_length|sl=i prompts_pad_left=i '
161 'logfile|lf=s logplay|lp=s profile|p=s '
161 'logfile|lf=s logplay|lp=s profile|p=s '
162 'readline! readline_merge_completions! '
162 'readline! readline_merge_completions! '
163 'readline_omit__names! '
163 'readline_omit__names! '
164 'rcfile=s separate_in|si=s separate_out|so=s '
164 'rcfile=s separate_in|si=s separate_out|so=s '
165 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
165 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
166 'magic_docstrings system_verbose! '
166 'magic_docstrings system_verbose! '
167 'multi_line_specials! '
167 'multi_line_specials! '
168 'wxversion=s '
168 'wxversion=s '
169 'autoedit_syntax!')
169 'autoedit_syntax!')
170
170
171 # Options that can *only* appear at the cmd line (not in rcfiles).
171 # Options that can *only* appear at the cmd line (not in rcfiles).
172
172
173 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
173 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
174 # the 'C-c !' command in emacs automatically appends a -i option at the end.
174 # the 'C-c !' command in emacs automatically appends a -i option at the end.
175 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
175 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
176 'gthread! qthread! wthread! pylab! tk!')
176 'gthread! qthread! wthread! pylab! tk!')
177
177
178 # Build the actual name list to be used by DPyGetOpt
178 # Build the actual name list to be used by DPyGetOpt
179 opts_names = qw(cmdline_opts) + qw(cmdline_only)
179 opts_names = qw(cmdline_opts) + qw(cmdline_only)
180
180
181 # Set sensible command line defaults.
181 # Set sensible command line defaults.
182 # This should have everything from cmdline_opts and cmdline_only
182 # This should have everything from cmdline_opts and cmdline_only
183 opts_def = Struct(autocall = 1,
183 opts_def = Struct(autocall = 1,
184 autoedit_syntax = 1,
184 autoedit_syntax = 0,
185 autoindent=0,
185 autoindent = 0,
186 automagic = 1,
186 automagic = 1,
187 banner = 1,
187 banner = 1,
188 cache_size = 1000,
188 cache_size = 1000,
189 c = '',
189 c = '',
190 classic = 0,
190 classic = 0,
191 colors = 'NoColor',
191 colors = 'NoColor',
192 color_info = 0,
192 color_info = 0,
193 confirm_exit = 1,
193 confirm_exit = 1,
194 debug = 0,
194 debug = 0,
195 deep_reload = 0,
195 deep_reload = 0,
196 editor = '0',
196 editor = '0',
197 help = 0,
197 help = 0,
198 ignore = 0,
198 ignore = 0,
199 ipythondir = ipythondir,
199 ipythondir = ipythondir,
200 log = 0,
200 log = 0,
201 logfile = '',
201 logfile = '',
202 logplay = '',
202 logplay = '',
203 multi_line_specials = 1,
203 multi_line_specials = 1,
204 messages = 1,
204 messages = 1,
205 nosep = 0,
205 nosep = 0,
206 pdb = 0,
206 pdb = 0,
207 pprint = 0,
207 pprint = 0,
208 profile = '',
208 profile = '',
209 prompt_in1 = 'In [\\#]: ',
209 prompt_in1 = 'In [\\#]: ',
210 prompt_in2 = ' .\\D.: ',
210 prompt_in2 = ' .\\D.: ',
211 prompt_out = 'Out[\\#]: ',
211 prompt_out = 'Out[\\#]: ',
212 prompts_pad_left = 1,
212 prompts_pad_left = 1,
213 quick = 0,
213 quick = 0,
214 readline = 1,
214 readline = 1,
215 readline_merge_completions = 1,
215 readline_merge_completions = 1,
216 readline_omit__names = 0,
216 readline_omit__names = 0,
217 rcfile = 'ipythonrc' + rc_suffix,
217 rcfile = 'ipythonrc' + rc_suffix,
218 screen_length = 0,
218 screen_length = 0,
219 separate_in = '\n',
219 separate_in = '\n',
220 separate_out = '\n',
220 separate_out = '\n',
221 separate_out2 = '',
221 separate_out2 = '',
222 system_verbose = 0,
222 system_verbose = 0,
223 gthread = 0,
223 gthread = 0,
224 qthread = 0,
224 qthread = 0,
225 wthread = 0,
225 wthread = 0,
226 pylab = 0,
226 pylab = 0,
227 tk = 0,
227 tk = 0,
228 upgrade = 0,
228 upgrade = 0,
229 Version = 0,
229 Version = 0,
230 xmode = 'Verbose',
230 xmode = 'Verbose',
231 wildcards_case_sensitive = 1,
231 wildcards_case_sensitive = 1,
232 wxversion = '0',
232 wxversion = '0',
233 magic_docstrings = 0, # undocumented, for doc generation
233 magic_docstrings = 0, # undocumented, for doc generation
234 )
234 )
235
235
236 # Things that will *only* appear in rcfiles (not at the command line).
236 # Things that will *only* appear in rcfiles (not at the command line).
237 # Make sure there's a space before each end of line (they get auto-joined!)
237 # Make sure there's a space before each end of line (they get auto-joined!)
238 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
238 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
239 qw_lol: 'import_some ',
239 qw_lol: 'import_some ',
240 # for things with embedded whitespace:
240 # for things with embedded whitespace:
241 list_strings:'execute alias readline_parse_and_bind ',
241 list_strings:'execute alias readline_parse_and_bind ',
242 # Regular strings need no conversion:
242 # Regular strings need no conversion:
243 None:'readline_remove_delims ',
243 None:'readline_remove_delims ',
244 }
244 }
245 # Default values for these
245 # Default values for these
246 rc_def = Struct(include = [],
246 rc_def = Struct(include = [],
247 import_mod = [],
247 import_mod = [],
248 import_all = [],
248 import_all = [],
249 import_some = [[]],
249 import_some = [[]],
250 execute = [],
250 execute = [],
251 execfile = [],
251 execfile = [],
252 alias = [],
252 alias = [],
253 readline_parse_and_bind = [],
253 readline_parse_and_bind = [],
254 readline_remove_delims = '',
254 readline_remove_delims = '',
255 )
255 )
256
256
257 # Build the type conversion dictionary from the above tables:
257 # Build the type conversion dictionary from the above tables:
258 typeconv = rcfile_opts.copy()
258 typeconv = rcfile_opts.copy()
259 typeconv.update(optstr2types(cmdline_opts))
259 typeconv.update(optstr2types(cmdline_opts))
260
260
261 # FIXME: the None key appears in both, put that back together by hand. Ugly!
261 # FIXME: the None key appears in both, put that back together by hand. Ugly!
262 typeconv[None] += ' ' + rcfile_opts[None]
262 typeconv[None] += ' ' + rcfile_opts[None]
263
263
264 # Remove quotes at ends of all strings (used to protect spaces)
264 # Remove quotes at ends of all strings (used to protect spaces)
265 typeconv[unquote_ends] = typeconv[None]
265 typeconv[unquote_ends] = typeconv[None]
266 del typeconv[None]
266 del typeconv[None]
267
267
268 # Build the list we'll use to make all config decisions with defaults:
268 # Build the list we'll use to make all config decisions with defaults:
269 opts_all = opts_def.copy()
269 opts_all = opts_def.copy()
270 opts_all.update(rc_def)
270 opts_all.update(rc_def)
271
271
272 # Build conflict resolver for recursive loading of config files:
272 # Build conflict resolver for recursive loading of config files:
273 # - preserve means the outermost file maintains the value, it is not
273 # - preserve means the outermost file maintains the value, it is not
274 # overwritten if an included file has the same key.
274 # overwritten if an included file has the same key.
275 # - add_flip applies + to the two values, so it better make sense to add
275 # - add_flip applies + to the two values, so it better make sense to add
276 # those types of keys. But it flips them first so that things loaded
276 # those types of keys. But it flips them first so that things loaded
277 # deeper in the inclusion chain have lower precedence.
277 # deeper in the inclusion chain have lower precedence.
278 conflict = {'preserve': ' '.join([ typeconv[int],
278 conflict = {'preserve': ' '.join([ typeconv[int],
279 typeconv[unquote_ends] ]),
279 typeconv[unquote_ends] ]),
280 'add_flip': ' '.join([ typeconv[qwflat],
280 'add_flip': ' '.join([ typeconv[qwflat],
281 typeconv[qw_lol],
281 typeconv[qw_lol],
282 typeconv[list_strings] ])
282 typeconv[list_strings] ])
283 }
283 }
284
284
285 # Now actually process the command line
285 # Now actually process the command line
286 getopt = DPyGetOpt.DPyGetOpt()
286 getopt = DPyGetOpt.DPyGetOpt()
287 getopt.setIgnoreCase(0)
287 getopt.setIgnoreCase(0)
288
288
289 getopt.parseConfiguration(opts_names)
289 getopt.parseConfiguration(opts_names)
290
290
291 try:
291 try:
292 getopt.processArguments(argv)
292 getopt.processArguments(argv)
293 except:
293 except:
294 print cmd_line_usage
294 print cmd_line_usage
295 warn('\nError in Arguments: ' + `sys.exc_value`)
295 warn('\nError in Arguments: ' + `sys.exc_value`)
296 sys.exit(1)
296 sys.exit(1)
297
297
298 # convert the options dict to a struct for much lighter syntax later
298 # convert the options dict to a struct for much lighter syntax later
299 opts = Struct(getopt.optionValues)
299 opts = Struct(getopt.optionValues)
300 args = getopt.freeValues
300 args = getopt.freeValues
301
301
302 # this is the struct (which has default values at this point) with which
302 # this is the struct (which has default values at this point) with which
303 # we make all decisions:
303 # we make all decisions:
304 opts_all.update(opts)
304 opts_all.update(opts)
305
305
306 # Options that force an immediate exit
306 # Options that force an immediate exit
307 if opts_all.help:
307 if opts_all.help:
308 page(cmd_line_usage)
308 page(cmd_line_usage)
309 sys.exit()
309 sys.exit()
310
310
311 if opts_all.Version:
311 if opts_all.Version:
312 print __version__
312 print __version__
313 sys.exit()
313 sys.exit()
314
314
315 if opts_all.magic_docstrings:
315 if opts_all.magic_docstrings:
316 IP.magic_magic('-latex')
316 IP.magic_magic('-latex')
317 sys.exit()
317 sys.exit()
318
318
319 # Create user config directory if it doesn't exist. This must be done
319 # Create user config directory if it doesn't exist. This must be done
320 # *after* getting the cmd line options.
320 # *after* getting the cmd line options.
321 if not os.path.isdir(opts_all.ipythondir):
321 if not os.path.isdir(opts_all.ipythondir):
322 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
322 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
323
323
324 # upgrade user config files while preserving a copy of the originals
324 # upgrade user config files while preserving a copy of the originals
325 if opts_all.upgrade:
325 if opts_all.upgrade:
326 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
326 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
327
327
328 # check mutually exclusive options in the *original* command line
328 # check mutually exclusive options in the *original* command line
329 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
329 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
330 qw('classic profile'),qw('classic rcfile')])
330 qw('classic profile'),qw('classic rcfile')])
331
331
332 #---------------------------------------------------------------------------
332 #---------------------------------------------------------------------------
333 # Log replay
333 # Log replay
334
334
335 # if -logplay, we need to 'become' the other session. That basically means
335 # if -logplay, we need to 'become' the other session. That basically means
336 # replacing the current command line environment with that of the old
336 # replacing the current command line environment with that of the old
337 # session and moving on.
337 # session and moving on.
338
338
339 # this is needed so that later we know we're in session reload mode, as
339 # this is needed so that later we know we're in session reload mode, as
340 # opts_all will get overwritten:
340 # opts_all will get overwritten:
341 load_logplay = 0
341 load_logplay = 0
342
342
343 if opts_all.logplay:
343 if opts_all.logplay:
344 load_logplay = opts_all.logplay
344 load_logplay = opts_all.logplay
345 opts_debug_save = opts_all.debug
345 opts_debug_save = opts_all.debug
346 try:
346 try:
347 logplay = open(opts_all.logplay)
347 logplay = open(opts_all.logplay)
348 except IOError:
348 except IOError:
349 if opts_all.debug: IP.InteractiveTB()
349 if opts_all.debug: IP.InteractiveTB()
350 warn('Could not open logplay file '+`opts_all.logplay`)
350 warn('Could not open logplay file '+`opts_all.logplay`)
351 # restore state as if nothing had happened and move on, but make
351 # restore state as if nothing had happened and move on, but make
352 # sure that later we don't try to actually load the session file
352 # sure that later we don't try to actually load the session file
353 logplay = None
353 logplay = None
354 load_logplay = 0
354 load_logplay = 0
355 del opts_all.logplay
355 del opts_all.logplay
356 else:
356 else:
357 try:
357 try:
358 logplay.readline()
358 logplay.readline()
359 logplay.readline();
359 logplay.readline();
360 # this reloads that session's command line
360 # this reloads that session's command line
361 cmd = logplay.readline()[6:]
361 cmd = logplay.readline()[6:]
362 exec cmd
362 exec cmd
363 # restore the true debug flag given so that the process of
363 # restore the true debug flag given so that the process of
364 # session loading itself can be monitored.
364 # session loading itself can be monitored.
365 opts.debug = opts_debug_save
365 opts.debug = opts_debug_save
366 # save the logplay flag so later we don't overwrite the log
366 # save the logplay flag so later we don't overwrite the log
367 opts.logplay = load_logplay
367 opts.logplay = load_logplay
368 # now we must update our own structure with defaults
368 # now we must update our own structure with defaults
369 opts_all.update(opts)
369 opts_all.update(opts)
370 # now load args
370 # now load args
371 cmd = logplay.readline()[6:]
371 cmd = logplay.readline()[6:]
372 exec cmd
372 exec cmd
373 logplay.close()
373 logplay.close()
374 except:
374 except:
375 logplay.close()
375 logplay.close()
376 if opts_all.debug: IP.InteractiveTB()
376 if opts_all.debug: IP.InteractiveTB()
377 warn("Logplay file lacking full configuration information.\n"
377 warn("Logplay file lacking full configuration information.\n"
378 "I'll try to read it, but some things may not work.")
378 "I'll try to read it, but some things may not work.")
379
379
380 #-------------------------------------------------------------------------
380 #-------------------------------------------------------------------------
381 # set up output traps: catch all output from files, being run, modules
381 # set up output traps: catch all output from files, being run, modules
382 # loaded, etc. Then give it to the user in a clean form at the end.
382 # loaded, etc. Then give it to the user in a clean form at the end.
383
383
384 msg_out = 'Output messages. '
384 msg_out = 'Output messages. '
385 msg_err = 'Error messages. '
385 msg_err = 'Error messages. '
386 msg_sep = '\n'
386 msg_sep = '\n'
387 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
387 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
388 msg_err,msg_sep,debug,
388 msg_err,msg_sep,debug,
389 quiet_out=1),
389 quiet_out=1),
390 user_exec = OutputTrap('User File Execution',msg_out,
390 user_exec = OutputTrap('User File Execution',msg_out,
391 msg_err,msg_sep,debug),
391 msg_err,msg_sep,debug),
392 logplay = OutputTrap('Log Loader',msg_out,
392 logplay = OutputTrap('Log Loader',msg_out,
393 msg_err,msg_sep,debug),
393 msg_err,msg_sep,debug),
394 summary = ''
394 summary = ''
395 )
395 )
396
396
397 #-------------------------------------------------------------------------
397 #-------------------------------------------------------------------------
398 # Process user ipythonrc-type configuration files
398 # Process user ipythonrc-type configuration files
399
399
400 # turn on output trapping and log to msg.config
400 # turn on output trapping and log to msg.config
401 # remember that with debug on, trapping is actually disabled
401 # remember that with debug on, trapping is actually disabled
402 msg.config.trap_all()
402 msg.config.trap_all()
403
403
404 # look for rcfile in current or default directory
404 # look for rcfile in current or default directory
405 try:
405 try:
406 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
406 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
407 except IOError:
407 except IOError:
408 if opts_all.debug: IP.InteractiveTB()
408 if opts_all.debug: IP.InteractiveTB()
409 warn('Configuration file %s not found. Ignoring request.'
409 warn('Configuration file %s not found. Ignoring request.'
410 % (opts_all.rcfile) )
410 % (opts_all.rcfile) )
411
411
412 # 'profiles' are a shorthand notation for config filenames
412 # 'profiles' are a shorthand notation for config filenames
413 if opts_all.profile:
413 if opts_all.profile:
414
414
415 try:
415 try:
416 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
416 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
417 + rc_suffix,
417 + rc_suffix,
418 opts_all.ipythondir)
418 opts_all.ipythondir)
419 except IOError:
419 except IOError:
420 if opts_all.debug: IP.InteractiveTB()
420 if opts_all.debug: IP.InteractiveTB()
421 opts.profile = '' # remove profile from options if invalid
421 opts.profile = '' # remove profile from options if invalid
422 # We won't warn anymore, primary method is ipy_profile_PROFNAME
422 # We won't warn anymore, primary method is ipy_profile_PROFNAME
423 # which does trigger a warning.
423 # which does trigger a warning.
424
424
425 # load the config file
425 # load the config file
426 rcfiledata = None
426 rcfiledata = None
427 if opts_all.quick:
427 if opts_all.quick:
428 print 'Launching IPython in quick mode. No config file read.'
428 print 'Launching IPython in quick mode. No config file read.'
429 elif opts_all.classic:
429 elif opts_all.classic:
430 print 'Launching IPython in classic mode. No config file read.'
430 print 'Launching IPython in classic mode. No config file read.'
431 elif opts_all.rcfile:
431 elif opts_all.rcfile:
432 try:
432 try:
433 cfg_loader = ConfigLoader(conflict)
433 cfg_loader = ConfigLoader(conflict)
434 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
434 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
435 'include',opts_all.ipythondir,
435 'include',opts_all.ipythondir,
436 purge = 1,
436 purge = 1,
437 unique = conflict['preserve'])
437 unique = conflict['preserve'])
438 except:
438 except:
439 IP.InteractiveTB()
439 IP.InteractiveTB()
440 warn('Problems loading configuration file '+
440 warn('Problems loading configuration file '+
441 `opts_all.rcfile`+
441 `opts_all.rcfile`+
442 '\nStarting with default -bare bones- configuration.')
442 '\nStarting with default -bare bones- configuration.')
443 else:
443 else:
444 warn('No valid configuration file found in either currrent directory\n'+
444 warn('No valid configuration file found in either currrent directory\n'+
445 'or in the IPython config. directory: '+`opts_all.ipythondir`+
445 'or in the IPython config. directory: '+`opts_all.ipythondir`+
446 '\nProceeding with internal defaults.')
446 '\nProceeding with internal defaults.')
447
447
448 #------------------------------------------------------------------------
448 #------------------------------------------------------------------------
449 # Set exception handlers in mode requested by user.
449 # Set exception handlers in mode requested by user.
450 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
450 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
451 IP.magic_xmode(opts_all.xmode)
451 IP.magic_xmode(opts_all.xmode)
452 otrap.release_out()
452 otrap.release_out()
453
453
454 #------------------------------------------------------------------------
454 #------------------------------------------------------------------------
455 # Execute user config
455 # Execute user config
456
456
457 # Create a valid config structure with the right precedence order:
457 # Create a valid config structure with the right precedence order:
458 # defaults < rcfile < command line. This needs to be in the instance, so
458 # defaults < rcfile < command line. This needs to be in the instance, so
459 # that method calls below that rely on it find it.
459 # that method calls below that rely on it find it.
460 IP.rc = rc_def.copy()
460 IP.rc = rc_def.copy()
461
461
462 # Work with a local alias inside this routine to avoid unnecessary
462 # Work with a local alias inside this routine to avoid unnecessary
463 # attribute lookups.
463 # attribute lookups.
464 IP_rc = IP.rc
464 IP_rc = IP.rc
465
465
466 IP_rc.update(opts_def)
466 IP_rc.update(opts_def)
467 if rcfiledata:
467 if rcfiledata:
468 # now we can update
468 # now we can update
469 IP_rc.update(rcfiledata)
469 IP_rc.update(rcfiledata)
470 IP_rc.update(opts)
470 IP_rc.update(opts)
471 IP_rc.update(rc_override)
471 IP_rc.update(rc_override)
472
472
473 # Store the original cmd line for reference:
473 # Store the original cmd line for reference:
474 IP_rc.opts = opts
474 IP_rc.opts = opts
475 IP_rc.args = args
475 IP_rc.args = args
476
476
477 # create a *runtime* Struct like rc for holding parameters which may be
477 # create a *runtime* Struct like rc for holding parameters which may be
478 # created and/or modified by runtime user extensions.
478 # created and/or modified by runtime user extensions.
479 IP.runtime_rc = Struct()
479 IP.runtime_rc = Struct()
480
480
481 # from this point on, all config should be handled through IP_rc,
481 # from this point on, all config should be handled through IP_rc,
482 # opts* shouldn't be used anymore.
482 # opts* shouldn't be used anymore.
483
483
484
484
485 # update IP_rc with some special things that need manual
485 # update IP_rc with some special things that need manual
486 # tweaks. Basically options which affect other options. I guess this
486 # tweaks. Basically options which affect other options. I guess this
487 # should just be written so that options are fully orthogonal and we
487 # should just be written so that options are fully orthogonal and we
488 # wouldn't worry about this stuff!
488 # wouldn't worry about this stuff!
489
489
490 if IP_rc.classic:
490 if IP_rc.classic:
491 IP_rc.quick = 1
491 IP_rc.quick = 1
492 IP_rc.cache_size = 0
492 IP_rc.cache_size = 0
493 IP_rc.pprint = 0
493 IP_rc.pprint = 0
494 IP_rc.prompt_in1 = '>>> '
494 IP_rc.prompt_in1 = '>>> '
495 IP_rc.prompt_in2 = '... '
495 IP_rc.prompt_in2 = '... '
496 IP_rc.prompt_out = ''
496 IP_rc.prompt_out = ''
497 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
497 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
498 IP_rc.colors = 'NoColor'
498 IP_rc.colors = 'NoColor'
499 IP_rc.xmode = 'Plain'
499 IP_rc.xmode = 'Plain'
500
500
501 IP.pre_config_initialization()
501 IP.pre_config_initialization()
502 # configure readline
502 # configure readline
503 # Define the history file for saving commands in between sessions
503 # Define the history file for saving commands in between sessions
504 if IP_rc.profile:
504 if IP_rc.profile:
505 histfname = 'history-%s' % IP_rc.profile
505 histfname = 'history-%s' % IP_rc.profile
506 else:
506 else:
507 histfname = 'history'
507 histfname = 'history'
508 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
508 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
509
509
510 # update exception handlers with rc file status
510 # update exception handlers with rc file status
511 otrap.trap_out() # I don't want these messages ever.
511 otrap.trap_out() # I don't want these messages ever.
512 IP.magic_xmode(IP_rc.xmode)
512 IP.magic_xmode(IP_rc.xmode)
513 otrap.release_out()
513 otrap.release_out()
514
514
515 # activate logging if requested and not reloading a log
515 # activate logging if requested and not reloading a log
516 if IP_rc.logplay:
516 if IP_rc.logplay:
517 IP.magic_logstart(IP_rc.logplay + ' append')
517 IP.magic_logstart(IP_rc.logplay + ' append')
518 elif IP_rc.logfile:
518 elif IP_rc.logfile:
519 IP.magic_logstart(IP_rc.logfile)
519 IP.magic_logstart(IP_rc.logfile)
520 elif IP_rc.log:
520 elif IP_rc.log:
521 IP.magic_logstart()
521 IP.magic_logstart()
522
522
523 # find user editor so that it we don't have to look it up constantly
523 # find user editor so that it we don't have to look it up constantly
524 if IP_rc.editor.strip()=='0':
524 if IP_rc.editor.strip()=='0':
525 try:
525 try:
526 ed = os.environ['EDITOR']
526 ed = os.environ['EDITOR']
527 except KeyError:
527 except KeyError:
528 if os.name == 'posix':
528 if os.name == 'posix':
529 ed = 'vi' # the only one guaranteed to be there!
529 ed = 'vi' # the only one guaranteed to be there!
530 else:
530 else:
531 ed = 'notepad' # same in Windows!
531 ed = 'notepad' # same in Windows!
532 IP_rc.editor = ed
532 IP_rc.editor = ed
533
533
534 # Keep track of whether this is an embedded instance or not (useful for
534 # Keep track of whether this is an embedded instance or not (useful for
535 # post-mortems).
535 # post-mortems).
536 IP_rc.embedded = IP.embedded
536 IP_rc.embedded = IP.embedded
537
537
538 # Recursive reload
538 # Recursive reload
539 try:
539 try:
540 from IPython import deep_reload
540 from IPython import deep_reload
541 if IP_rc.deep_reload:
541 if IP_rc.deep_reload:
542 __builtin__.reload = deep_reload.reload
542 __builtin__.reload = deep_reload.reload
543 else:
543 else:
544 __builtin__.dreload = deep_reload.reload
544 __builtin__.dreload = deep_reload.reload
545 del deep_reload
545 del deep_reload
546 except ImportError:
546 except ImportError:
547 pass
547 pass
548
548
549 # Save the current state of our namespace so that the interactive shell
549 # Save the current state of our namespace so that the interactive shell
550 # can later know which variables have been created by us from config files
550 # can later know which variables have been created by us from config files
551 # and loading. This way, loading a file (in any way) is treated just like
551 # and loading. This way, loading a file (in any way) is treated just like
552 # defining things on the command line, and %who works as expected.
552 # defining things on the command line, and %who works as expected.
553
553
554 # DON'T do anything that affects the namespace beyond this point!
554 # DON'T do anything that affects the namespace beyond this point!
555 IP.internal_ns.update(__main__.__dict__)
555 IP.internal_ns.update(__main__.__dict__)
556
556
557 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
557 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
558
558
559 # Now run through the different sections of the users's config
559 # Now run through the different sections of the users's config
560 if IP_rc.debug:
560 if IP_rc.debug:
561 print 'Trying to execute the following configuration structure:'
561 print 'Trying to execute the following configuration structure:'
562 print '(Things listed first are deeper in the inclusion tree and get'
562 print '(Things listed first are deeper in the inclusion tree and get'
563 print 'loaded first).\n'
563 print 'loaded first).\n'
564 pprint(IP_rc.__dict__)
564 pprint(IP_rc.__dict__)
565
565
566 for mod in IP_rc.import_mod:
566 for mod in IP_rc.import_mod:
567 try:
567 try:
568 exec 'import '+mod in IP.user_ns
568 exec 'import '+mod in IP.user_ns
569 except :
569 except :
570 IP.InteractiveTB()
570 IP.InteractiveTB()
571 import_fail_info(mod)
571 import_fail_info(mod)
572
572
573 for mod_fn in IP_rc.import_some:
573 for mod_fn in IP_rc.import_some:
574 if mod_fn == []: break
574 if mod_fn == []: break
575 mod,fn = mod_fn[0],','.join(mod_fn[1:])
575 mod,fn = mod_fn[0],','.join(mod_fn[1:])
576 try:
576 try:
577 exec 'from '+mod+' import '+fn in IP.user_ns
577 exec 'from '+mod+' import '+fn in IP.user_ns
578 except :
578 except :
579 IP.InteractiveTB()
579 IP.InteractiveTB()
580 import_fail_info(mod,fn)
580 import_fail_info(mod,fn)
581
581
582 for mod in IP_rc.import_all:
582 for mod in IP_rc.import_all:
583 try:
583 try:
584 exec 'from '+mod+' import *' in IP.user_ns
584 exec 'from '+mod+' import *' in IP.user_ns
585 except :
585 except :
586 IP.InteractiveTB()
586 IP.InteractiveTB()
587 import_fail_info(mod)
587 import_fail_info(mod)
588
588
589 for code in IP_rc.execute:
589 for code in IP_rc.execute:
590 try:
590 try:
591 exec code in IP.user_ns
591 exec code in IP.user_ns
592 except:
592 except:
593 IP.InteractiveTB()
593 IP.InteractiveTB()
594 warn('Failure executing code: ' + `code`)
594 warn('Failure executing code: ' + `code`)
595
595
596 # Execute the files the user wants in ipythonrc
596 # Execute the files the user wants in ipythonrc
597 for file in IP_rc.execfile:
597 for file in IP_rc.execfile:
598 try:
598 try:
599 file = filefind(file,sys.path+[IPython_dir])
599 file = filefind(file,sys.path+[IPython_dir])
600 except IOError:
600 except IOError:
601 warn(itpl('File $file not found. Skipping it.'))
601 warn(itpl('File $file not found. Skipping it.'))
602 else:
602 else:
603 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
603 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
604
604
605 # finally, try importing ipy_*_conf for final configuration
605 # finally, try importing ipy_*_conf for final configuration
606 try:
606 try:
607 import ipy_system_conf
607 import ipy_system_conf
608 except ImportError:
608 except ImportError:
609 if opts_all.debug: IP.InteractiveTB()
609 if opts_all.debug: IP.InteractiveTB()
610 warn("Could not import 'ipy_system_conf'")
610 warn("Could not import 'ipy_system_conf'")
611 except:
611 except:
612 IP.InteractiveTB()
612 IP.InteractiveTB()
613 import_fail_info('ipy_system_conf')
613 import_fail_info('ipy_system_conf')
614
614
615 if opts_all.profile:
615 if opts_all.profile:
616 profmodname = 'ipy_profile_' + opts_all.profile
616 profmodname = 'ipy_profile_' + opts_all.profile
617 try:
617 try:
618 __import__(profmodname)
618 __import__(profmodname)
619 except ImportError:
619 except ImportError:
620 # only warn if ipythonrc-PROFNAME didn't exist
620 # only warn if ipythonrc-PROFNAME didn't exist
621 if opts.profile =='':
621 if opts.profile =='':
622 warn("Could not start with profile '%s'!\n ('%s/%s.py' does not exist? run '%%upgrade')" % (
622 warn("Could not start with profile '%s'!\n ('%s/%s.py' does not exist? run '%%upgrade')" % (
623 opts_all.profile, ipythondir, profmodname)
623 opts_all.profile, ipythondir, profmodname)
624
624
625 )
625 )
626 except:
626 except:
627 print "Error importing",profmodname
627 print "Error importing",profmodname
628 IP.InteractiveTB()
628 IP.InteractiveTB()
629 import_fail_info(profmodname)
629 import_fail_info(profmodname)
630
630
631 try:
631 try:
632 import ipy_user_conf
632 import ipy_user_conf
633 except ImportError:
633 except ImportError:
634 if opts_all.debug: IP.InteractiveTB()
634 if opts_all.debug: IP.InteractiveTB()
635 warn("Could not import user config!\n ('%s/ipy_user_conf.py' does not exist? Please run '%%upgrade')\n" %
635 warn("Could not import user config!\n ('%s/ipy_user_conf.py' does not exist? Please run '%%upgrade')\n" %
636 ipythondir)
636 ipythondir)
637 except:
637 except:
638 print "Error importing ipy_user_conf"
638 print "Error importing ipy_user_conf"
639 IP.InteractiveTB()
639 IP.InteractiveTB()
640 import_fail_info("ipy_user_conf")
640 import_fail_info("ipy_user_conf")
641
641
642
642
643 # release stdout and stderr and save config log into a global summary
643 # release stdout and stderr and save config log into a global summary
644 msg.config.release_all()
644 msg.config.release_all()
645 if IP_rc.messages:
645 if IP_rc.messages:
646 msg.summary += msg.config.summary_all()
646 msg.summary += msg.config.summary_all()
647
647
648 #------------------------------------------------------------------------
648 #------------------------------------------------------------------------
649 # Setup interactive session
649 # Setup interactive session
650
650
651 # Now we should be fully configured. We can then execute files or load
651 # Now we should be fully configured. We can then execute files or load
652 # things only needed for interactive use. Then we'll open the shell.
652 # things only needed for interactive use. Then we'll open the shell.
653
653
654 # Take a snapshot of the user namespace before opening the shell. That way
654 # Take a snapshot of the user namespace before opening the shell. That way
655 # we'll be able to identify which things were interactively defined and
655 # we'll be able to identify which things were interactively defined and
656 # which were defined through config files.
656 # which were defined through config files.
657 IP.user_config_ns = IP.user_ns.copy()
657 IP.user_config_ns = IP.user_ns.copy()
658
658
659 # Force reading a file as if it were a session log. Slower but safer.
659 # Force reading a file as if it were a session log. Slower but safer.
660 if load_logplay:
660 if load_logplay:
661 print 'Replaying log...'
661 print 'Replaying log...'
662 try:
662 try:
663 if IP_rc.debug:
663 if IP_rc.debug:
664 logplay_quiet = 0
664 logplay_quiet = 0
665 else:
665 else:
666 logplay_quiet = 1
666 logplay_quiet = 1
667
667
668 msg.logplay.trap_all()
668 msg.logplay.trap_all()
669 IP.safe_execfile(load_logplay,IP.user_ns,
669 IP.safe_execfile(load_logplay,IP.user_ns,
670 islog = 1, quiet = logplay_quiet)
670 islog = 1, quiet = logplay_quiet)
671 msg.logplay.release_all()
671 msg.logplay.release_all()
672 if IP_rc.messages:
672 if IP_rc.messages:
673 msg.summary += msg.logplay.summary_all()
673 msg.summary += msg.logplay.summary_all()
674 except:
674 except:
675 warn('Problems replaying logfile %s.' % load_logplay)
675 warn('Problems replaying logfile %s.' % load_logplay)
676 IP.InteractiveTB()
676 IP.InteractiveTB()
677
677
678 # Load remaining files in command line
678 # Load remaining files in command line
679 msg.user_exec.trap_all()
679 msg.user_exec.trap_all()
680
680
681 # Do NOT execute files named in the command line as scripts to be loaded
681 # Do NOT execute files named in the command line as scripts to be loaded
682 # by embedded instances. Doing so has the potential for an infinite
682 # by embedded instances. Doing so has the potential for an infinite
683 # recursion if there are exceptions thrown in the process.
683 # recursion if there are exceptions thrown in the process.
684
684
685 # XXX FIXME: the execution of user files should be moved out to after
685 # XXX FIXME: the execution of user files should be moved out to after
686 # ipython is fully initialized, just as if they were run via %run at the
686 # ipython is fully initialized, just as if they were run via %run at the
687 # ipython prompt. This would also give them the benefit of ipython's
687 # ipython prompt. This would also give them the benefit of ipython's
688 # nice tracebacks.
688 # nice tracebacks.
689
689
690 if (not embedded and IP_rc.args and
690 if (not embedded and IP_rc.args and
691 not IP_rc.args[0].lower().endswith('.ipy')):
691 not IP_rc.args[0].lower().endswith('.ipy')):
692 name_save = IP.user_ns['__name__']
692 name_save = IP.user_ns['__name__']
693 IP.user_ns['__name__'] = '__main__'
693 IP.user_ns['__name__'] = '__main__'
694 # Set our own excepthook in case the user code tries to call it
694 # Set our own excepthook in case the user code tries to call it
695 # directly. This prevents triggering the IPython crash handler.
695 # directly. This prevents triggering the IPython crash handler.
696 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
696 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
697
697
698 save_argv = sys.argv[:] # save it for later restoring
698 save_argv = sys.argv[:] # save it for later restoring
699
699
700 sys.argv = args
700 sys.argv = args
701
701
702 try:
702 try:
703 IP.safe_execfile(args[0], IP.user_ns)
703 IP.safe_execfile(args[0], IP.user_ns)
704 finally:
704 finally:
705 # Reset our crash handler in place
705 # Reset our crash handler in place
706 sys.excepthook = old_excepthook
706 sys.excepthook = old_excepthook
707 sys.argv = save_argv
707 sys.argv = save_argv
708 IP.user_ns['__name__'] = name_save
708 IP.user_ns['__name__'] = name_save
709
709
710 msg.user_exec.release_all()
710 msg.user_exec.release_all()
711 if IP_rc.messages:
711 if IP_rc.messages:
712 msg.summary += msg.user_exec.summary_all()
712 msg.summary += msg.user_exec.summary_all()
713
713
714 # since we can't specify a null string on the cmd line, 0 is the equivalent:
714 # since we can't specify a null string on the cmd line, 0 is the equivalent:
715 if IP_rc.nosep:
715 if IP_rc.nosep:
716 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
716 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
717 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
717 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
718 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
718 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
719 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
719 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
720 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
720 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
721 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
721 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
722 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
722 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
723
723
724 # Determine how many lines at the bottom of the screen are needed for
724 # Determine how many lines at the bottom of the screen are needed for
725 # showing prompts, so we can know wheter long strings are to be printed or
725 # showing prompts, so we can know wheter long strings are to be printed or
726 # paged:
726 # paged:
727 num_lines_bot = IP_rc.separate_in.count('\n')+1
727 num_lines_bot = IP_rc.separate_in.count('\n')+1
728 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
728 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
729
729
730 # configure startup banner
730 # configure startup banner
731 if IP_rc.c: # regular python doesn't print the banner with -c
731 if IP_rc.c: # regular python doesn't print the banner with -c
732 IP_rc.banner = 0
732 IP_rc.banner = 0
733 if IP_rc.banner:
733 if IP_rc.banner:
734 BANN_P = IP.BANNER_PARTS
734 BANN_P = IP.BANNER_PARTS
735 else:
735 else:
736 BANN_P = []
736 BANN_P = []
737
737
738 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
738 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
739
739
740 # add message log (possibly empty)
740 # add message log (possibly empty)
741 if msg.summary: BANN_P.append(msg.summary)
741 if msg.summary: BANN_P.append(msg.summary)
742 # Final banner is a string
742 # Final banner is a string
743 IP.BANNER = '\n'.join(BANN_P)
743 IP.BANNER = '\n'.join(BANN_P)
744
744
745 # Finalize the IPython instance. This assumes the rc structure is fully
745 # Finalize the IPython instance. This assumes the rc structure is fully
746 # in place.
746 # in place.
747 IP.post_config_initialization()
747 IP.post_config_initialization()
748
748
749 return IP
749 return IP
750 #************************ end of file <ipmaker.py> **************************
750 #************************ end of file <ipmaker.py> **************************
@@ -1,5407 +1,5420 b''
1 2006-05-24 Fernando Perez <Fernando.Perez@colorado.edu>
1 2006-05-24 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
4 python-mode recognizes our debugger mode.
5
6 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
7 tracebacks when walking the stack so that the stack tracking system
8 in emacs' python-mode can identify the frames correctly.
9
10 * IPython/ipmaker.py (make_IPython): make the internal (and
11 default config) autoedit_syntax value false by default. Too many
12 users have complained to me (both on and off-list) about problems
13 with this option being on by default, so I'm making it default to
14 off. It can still be enabled by anyone via the usual mechanisms.
15
3 * IPython/completer.py (Completer.attr_matches): add support for
16 * IPython/completer.py (Completer.attr_matches): add support for
4 PyCrust-style _getAttributeNames magic method. Patch contributed
17 PyCrust-style _getAttributeNames magic method. Patch contributed
5 by <mscott-AT-goldenspud.com>. Closes #50.
18 by <mscott-AT-goldenspud.com>. Closes #50.
6
19
7 * IPython/iplib.py (InteractiveShell.__init__): remove the
20 * IPython/iplib.py (InteractiveShell.__init__): remove the
8 deletion of exit/quit from __builtin__, which can break
21 deletion of exit/quit from __builtin__, which can break
9 third-party tools like the Zope debugging console. The
22 third-party tools like the Zope debugging console. The
10 %exit/%quit magics remain. In general, it's probably a good idea
23 %exit/%quit magics remain. In general, it's probably a good idea
11 not to delete anything from __builtin__, since we never know what
24 not to delete anything from __builtin__, since we never know what
12 that will break. In any case, python now (for 2.5) will support
25 that will break. In any case, python now (for 2.5) will support
13 'real' exit/quit, so this issue is moot. Closes #55.
26 'real' exit/quit, so this issue is moot. Closes #55.
14
27
15 * IPython/genutils.py (with_obj): rename the 'with' function to
28 * IPython/genutils.py (with_obj): rename the 'with' function to
16 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
29 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
17 becomes a language keyword. Closes #53.
30 becomes a language keyword. Closes #53.
18
31
19 * IPython/FakeModule.py (FakeModule.__init__): add a proper
32 * IPython/FakeModule.py (FakeModule.__init__): add a proper
20 __file__ attribute to this so it fools more things into thinking
33 __file__ attribute to this so it fools more things into thinking
21 it is a real module. Closes #59.
34 it is a real module. Closes #59.
22
35
23 * IPython/Magic.py (magic_edit): add -n option to open the editor
36 * IPython/Magic.py (magic_edit): add -n option to open the editor
24 at a specific line number. After a patch by Stefan van der Walt.
37 at a specific line number. After a patch by Stefan van der Walt.
25
38
26 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
39 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
27
40
28 * IPython/iplib.py (edit_syntax_error): fix crash when for some
41 * IPython/iplib.py (edit_syntax_error): fix crash when for some
29 reason the file could not be opened. After automatic crash
42 reason the file could not be opened. After automatic crash
30 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
43 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
31 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
44 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
32 (_should_recompile): Don't fire editor if using %bg, since there
45 (_should_recompile): Don't fire editor if using %bg, since there
33 is no file in the first place. From the same report as above.
46 is no file in the first place. From the same report as above.
34 (raw_input): protect against faulty third-party prefilters. After
47 (raw_input): protect against faulty third-party prefilters. After
35 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
48 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
36 while running under SAGE.
49 while running under SAGE.
37
50
38 2006-05-23 Ville Vainio <vivainio@gmail.com>
51 2006-05-23 Ville Vainio <vivainio@gmail.com>
39
52
40 * ipapi.py: Stripped down ip.to_user_ns() to work only as
53 * ipapi.py: Stripped down ip.to_user_ns() to work only as
41 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
54 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
42 now returns None (again), unless dummy is specifically allowed by
55 now returns None (again), unless dummy is specifically allowed by
43 ipapi.get(allow_dummy=True).
56 ipapi.get(allow_dummy=True).
44
57
45 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
58 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
46
59
47 * IPython: remove all 2.2-compatibility objects and hacks from
60 * IPython: remove all 2.2-compatibility objects and hacks from
48 everywhere, since we only support 2.3 at this point. Docs
61 everywhere, since we only support 2.3 at this point. Docs
49 updated.
62 updated.
50
63
51 * IPython/ipapi.py (IPApi.__init__): Clean up of all getters.
64 * IPython/ipapi.py (IPApi.__init__): Clean up of all getters.
52 Anything requiring extra validation can be turned into a Python
65 Anything requiring extra validation can be turned into a Python
53 property in the future. I used a property for the db one b/c
66 property in the future. I used a property for the db one b/c
54 there was a nasty circularity problem with the initialization
67 there was a nasty circularity problem with the initialization
55 order, which right now I don't have time to clean up.
68 order, which right now I don't have time to clean up.
56
69
57 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
70 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
58 another locking bug reported by Jorgen. I'm not 100% sure though,
71 another locking bug reported by Jorgen. I'm not 100% sure though,
59 so more testing is needed...
72 so more testing is needed...
60
73
61 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
74 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
62
75
63 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
76 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
64 local variables from any routine in user code (typically executed
77 local variables from any routine in user code (typically executed
65 with %run) directly into the interactive namespace. Very useful
78 with %run) directly into the interactive namespace. Very useful
66 when doing complex debugging.
79 when doing complex debugging.
67 (IPythonNotRunning): Changed the default None object to a dummy
80 (IPythonNotRunning): Changed the default None object to a dummy
68 whose attributes can be queried as well as called without
81 whose attributes can be queried as well as called without
69 exploding, to ease writing code which works transparently both in
82 exploding, to ease writing code which works transparently both in
70 and out of ipython and uses some of this API.
83 and out of ipython and uses some of this API.
71
84
72 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
85 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
73
86
74 * IPython/hooks.py (result_display): Fix the fact that our display
87 * IPython/hooks.py (result_display): Fix the fact that our display
75 hook was using str() instead of repr(), as the default python
88 hook was using str() instead of repr(), as the default python
76 console does. This had gone unnoticed b/c it only happened if
89 console does. This had gone unnoticed b/c it only happened if
77 %Pprint was off, but the inconsistency was there.
90 %Pprint was off, but the inconsistency was there.
78
91
79 2006-05-15 Ville Vainio <vivainio@gmail.com>
92 2006-05-15 Ville Vainio <vivainio@gmail.com>
80
93
81 * Oinspect.py: Only show docstring for nonexisting/binary files
94 * Oinspect.py: Only show docstring for nonexisting/binary files
82 when doing object??, closing ticket #62
95 when doing object??, closing ticket #62
83
96
84 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
97 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
85
98
86 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
99 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
87 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
100 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
88 was being released in a routine which hadn't checked if it had
101 was being released in a routine which hadn't checked if it had
89 been the one to acquire it.
102 been the one to acquire it.
90
103
91 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
104 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
92
105
93 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
106 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
94
107
95 2006-04-11 Ville Vainio <vivainio@gmail.com>
108 2006-04-11 Ville Vainio <vivainio@gmail.com>
96
109
97 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
110 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
98 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
111 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
99 prefilters, allowing stuff like magics and aliases in the file.
112 prefilters, allowing stuff like magics and aliases in the file.
100
113
101 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
114 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
102 added. Supported now are "%clear in" and "%clear out" (clear input and
115 added. Supported now are "%clear in" and "%clear out" (clear input and
103 output history, respectively). Also fixed CachedOutput.flush to
116 output history, respectively). Also fixed CachedOutput.flush to
104 properly flush the output cache.
117 properly flush the output cache.
105
118
106 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
119 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
107 half-success (and fail explicitly).
120 half-success (and fail explicitly).
108
121
109 2006-03-28 Ville Vainio <vivainio@gmail.com>
122 2006-03-28 Ville Vainio <vivainio@gmail.com>
110
123
111 * iplib.py: Fix quoting of aliases so that only argless ones
124 * iplib.py: Fix quoting of aliases so that only argless ones
112 are quoted
125 are quoted
113
126
114 2006-03-28 Ville Vainio <vivainio@gmail.com>
127 2006-03-28 Ville Vainio <vivainio@gmail.com>
115
128
116 * iplib.py: Quote aliases with spaces in the name.
129 * iplib.py: Quote aliases with spaces in the name.
117 "c:\program files\blah\bin" is now legal alias target.
130 "c:\program files\blah\bin" is now legal alias target.
118
131
119 * ext_rehashdir.py: Space no longer allowed as arg
132 * ext_rehashdir.py: Space no longer allowed as arg
120 separator, since space is legal in path names.
133 separator, since space is legal in path names.
121
134
122 2006-03-16 Ville Vainio <vivainio@gmail.com>
135 2006-03-16 Ville Vainio <vivainio@gmail.com>
123
136
124 * upgrade_dir.py: Take path.py from Extensions, correcting
137 * upgrade_dir.py: Take path.py from Extensions, correcting
125 %upgrade magic
138 %upgrade magic
126
139
127 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
140 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
128
141
129 * hooks.py: Only enclose editor binary in quotes if legal and
142 * hooks.py: Only enclose editor binary in quotes if legal and
130 necessary (space in the name, and is an existing file). Fixes a bug
143 necessary (space in the name, and is an existing file). Fixes a bug
131 reported by Zachary Pincus.
144 reported by Zachary Pincus.
132
145
133 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
146 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
134
147
135 * Manual: thanks to a tip on proper color handling for Emacs, by
148 * Manual: thanks to a tip on proper color handling for Emacs, by
136 Eric J Haywiser <ejh1-AT-MIT.EDU>.
149 Eric J Haywiser <ejh1-AT-MIT.EDU>.
137
150
138 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
151 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
139 by applying the provided patch. Thanks to Liu Jin
152 by applying the provided patch. Thanks to Liu Jin
140 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
153 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
141 XEmacs/Linux, I'm trusting the submitter that it actually helps
154 XEmacs/Linux, I'm trusting the submitter that it actually helps
142 under win32/GNU Emacs. Will revisit if any problems are reported.
155 under win32/GNU Emacs. Will revisit if any problems are reported.
143
156
144 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
157 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
145
158
146 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
159 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
147 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
160 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
148
161
149 2006-03-12 Ville Vainio <vivainio@gmail.com>
162 2006-03-12 Ville Vainio <vivainio@gmail.com>
150
163
151 * Magic.py (magic_timeit): Added %timeit magic, contributed by
164 * Magic.py (magic_timeit): Added %timeit magic, contributed by
152 Torsten Marek.
165 Torsten Marek.
153
166
154 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
167 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
155
168
156 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
169 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
157 line ranges works again.
170 line ranges works again.
158
171
159 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
172 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
160
173
161 * IPython/iplib.py (showtraceback): add back sys.last_traceback
174 * IPython/iplib.py (showtraceback): add back sys.last_traceback
162 and friends, after a discussion with Zach Pincus on ipython-user.
175 and friends, after a discussion with Zach Pincus on ipython-user.
163 I'm not 100% sure, but after thinking aobut it quite a bit, it may
176 I'm not 100% sure, but after thinking aobut it quite a bit, it may
164 be OK. Testing with the multithreaded shells didn't reveal any
177 be OK. Testing with the multithreaded shells didn't reveal any
165 problems, but let's keep an eye out.
178 problems, but let's keep an eye out.
166
179
167 In the process, I fixed a few things which were calling
180 In the process, I fixed a few things which were calling
168 self.InteractiveTB() directly (like safe_execfile), which is a
181 self.InteractiveTB() directly (like safe_execfile), which is a
169 mistake: ALL exception reporting should be done by calling
182 mistake: ALL exception reporting should be done by calling
170 self.showtraceback(), which handles state and tab-completion and
183 self.showtraceback(), which handles state and tab-completion and
171 more.
184 more.
172
185
173 2006-03-01 Ville Vainio <vivainio@gmail.com>
186 2006-03-01 Ville Vainio <vivainio@gmail.com>
174
187
175 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
188 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
176 To use, do "from ipipe import *".
189 To use, do "from ipipe import *".
177
190
178 2006-02-24 Ville Vainio <vivainio@gmail.com>
191 2006-02-24 Ville Vainio <vivainio@gmail.com>
179
192
180 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
193 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
181 "cleanly" and safely than the older upgrade mechanism.
194 "cleanly" and safely than the older upgrade mechanism.
182
195
183 2006-02-21 Ville Vainio <vivainio@gmail.com>
196 2006-02-21 Ville Vainio <vivainio@gmail.com>
184
197
185 * Magic.py: %save works again.
198 * Magic.py: %save works again.
186
199
187 2006-02-15 Ville Vainio <vivainio@gmail.com>
200 2006-02-15 Ville Vainio <vivainio@gmail.com>
188
201
189 * Magic.py: %Pprint works again
202 * Magic.py: %Pprint works again
190
203
191 * Extensions/ipy_sane_defaults.py: Provide everything provided
204 * Extensions/ipy_sane_defaults.py: Provide everything provided
192 in default ipythonrc, to make it possible to have a completely empty
205 in default ipythonrc, to make it possible to have a completely empty
193 ipythonrc (and thus completely rc-file free configuration)
206 ipythonrc (and thus completely rc-file free configuration)
194
207
195
208
196 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
209 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
197
210
198 * IPython/hooks.py (editor): quote the call to the editor command,
211 * IPython/hooks.py (editor): quote the call to the editor command,
199 to allow commands with spaces in them. Problem noted by watching
212 to allow commands with spaces in them. Problem noted by watching
200 Ian Oswald's video about textpad under win32 at
213 Ian Oswald's video about textpad under win32 at
201 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
214 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
202
215
203 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
216 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
204 describing magics (we haven't used @ for a loong time).
217 describing magics (we haven't used @ for a loong time).
205
218
206 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
219 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
207 contributed by marienz to close
220 contributed by marienz to close
208 http://www.scipy.net/roundup/ipython/issue53.
221 http://www.scipy.net/roundup/ipython/issue53.
209
222
210 2006-02-10 Ville Vainio <vivainio@gmail.com>
223 2006-02-10 Ville Vainio <vivainio@gmail.com>
211
224
212 * genutils.py: getoutput now works in win32 too
225 * genutils.py: getoutput now works in win32 too
213
226
214 * completer.py: alias and magic completion only invoked
227 * completer.py: alias and magic completion only invoked
215 at the first "item" in the line, to avoid "cd %store"
228 at the first "item" in the line, to avoid "cd %store"
216 nonsense.
229 nonsense.
217
230
218 2006-02-09 Ville Vainio <vivainio@gmail.com>
231 2006-02-09 Ville Vainio <vivainio@gmail.com>
219
232
220 * test/*: Added a unit testing framework (finally).
233 * test/*: Added a unit testing framework (finally).
221 '%run runtests.py' to run test_*.
234 '%run runtests.py' to run test_*.
222
235
223 * ipapi.py: Exposed runlines and set_custom_exc
236 * ipapi.py: Exposed runlines and set_custom_exc
224
237
225 2006-02-07 Ville Vainio <vivainio@gmail.com>
238 2006-02-07 Ville Vainio <vivainio@gmail.com>
226
239
227 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
240 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
228 instead use "f(1 2)" as before.
241 instead use "f(1 2)" as before.
229
242
230 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
243 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
231
244
232 * IPython/demo.py (IPythonDemo): Add new classes to the demo
245 * IPython/demo.py (IPythonDemo): Add new classes to the demo
233 facilities, for demos processed by the IPython input filter
246 facilities, for demos processed by the IPython input filter
234 (IPythonDemo), and for running a script one-line-at-a-time as a
247 (IPythonDemo), and for running a script one-line-at-a-time as a
235 demo, both for pure Python (LineDemo) and for IPython-processed
248 demo, both for pure Python (LineDemo) and for IPython-processed
236 input (IPythonLineDemo). After a request by Dave Kohel, from the
249 input (IPythonLineDemo). After a request by Dave Kohel, from the
237 SAGE team.
250 SAGE team.
238 (Demo.edit): added and edit() method to the demo objects, to edit
251 (Demo.edit): added and edit() method to the demo objects, to edit
239 the in-memory copy of the last executed block.
252 the in-memory copy of the last executed block.
240
253
241 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
254 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
242 processing to %edit, %macro and %save. These commands can now be
255 processing to %edit, %macro and %save. These commands can now be
243 invoked on the unprocessed input as it was typed by the user
256 invoked on the unprocessed input as it was typed by the user
244 (without any prefilters applied). After requests by the SAGE team
257 (without any prefilters applied). After requests by the SAGE team
245 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
258 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
246
259
247 2006-02-01 Ville Vainio <vivainio@gmail.com>
260 2006-02-01 Ville Vainio <vivainio@gmail.com>
248
261
249 * setup.py, eggsetup.py: easy_install ipython==dev works
262 * setup.py, eggsetup.py: easy_install ipython==dev works
250 correctly now (on Linux)
263 correctly now (on Linux)
251
264
252 * ipy_user_conf,ipmaker: user config changes, removed spurious
265 * ipy_user_conf,ipmaker: user config changes, removed spurious
253 warnings
266 warnings
254
267
255 * iplib: if rc.banner is string, use it as is.
268 * iplib: if rc.banner is string, use it as is.
256
269
257 * Magic: %pycat accepts a string argument and pages it's contents.
270 * Magic: %pycat accepts a string argument and pages it's contents.
258
271
259
272
260 2006-01-30 Ville Vainio <vivainio@gmail.com>
273 2006-01-30 Ville Vainio <vivainio@gmail.com>
261
274
262 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
275 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
263 Now %store and bookmarks work through PickleShare, meaning that
276 Now %store and bookmarks work through PickleShare, meaning that
264 concurrent access is possible and all ipython sessions see the
277 concurrent access is possible and all ipython sessions see the
265 same database situation all the time, instead of snapshot of
278 same database situation all the time, instead of snapshot of
266 the situation when the session was started. Hence, %bookmark
279 the situation when the session was started. Hence, %bookmark
267 results are immediately accessible from othes sessions. The database
280 results are immediately accessible from othes sessions. The database
268 is also available for use by user extensions. See:
281 is also available for use by user extensions. See:
269 http://www.python.org/pypi/pickleshare
282 http://www.python.org/pypi/pickleshare
270
283
271 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
284 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
272
285
273 * aliases can now be %store'd
286 * aliases can now be %store'd
274
287
275 * path.py move to Extensions so that pickleshare does not need
288 * path.py move to Extensions so that pickleshare does not need
276 IPython-specific import. Extensions added to pythonpath right
289 IPython-specific import. Extensions added to pythonpath right
277 at __init__.
290 at __init__.
278
291
279 * iplib.py: ipalias deprecated/redundant; aliases are converted and
292 * iplib.py: ipalias deprecated/redundant; aliases are converted and
280 called with _ip.system and the pre-transformed command string.
293 called with _ip.system and the pre-transformed command string.
281
294
282 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
295 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
283
296
284 * IPython/iplib.py (interact): Fix that we were not catching
297 * IPython/iplib.py (interact): Fix that we were not catching
285 KeyboardInterrupt exceptions properly. I'm not quite sure why the
298 KeyboardInterrupt exceptions properly. I'm not quite sure why the
286 logic here had to change, but it's fixed now.
299 logic here had to change, but it's fixed now.
287
300
288 2006-01-29 Ville Vainio <vivainio@gmail.com>
301 2006-01-29 Ville Vainio <vivainio@gmail.com>
289
302
290 * iplib.py: Try to import pyreadline on Windows.
303 * iplib.py: Try to import pyreadline on Windows.
291
304
292 2006-01-27 Ville Vainio <vivainio@gmail.com>
305 2006-01-27 Ville Vainio <vivainio@gmail.com>
293
306
294 * iplib.py: Expose ipapi as _ip in builtin namespace.
307 * iplib.py: Expose ipapi as _ip in builtin namespace.
295 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
308 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
296 and ip_set_hook (-> _ip.set_hook) redundant. % and !
309 and ip_set_hook (-> _ip.set_hook) redundant. % and !
297 syntax now produce _ip.* variant of the commands.
310 syntax now produce _ip.* variant of the commands.
298
311
299 * "_ip.options().autoedit_syntax = 2" automatically throws
312 * "_ip.options().autoedit_syntax = 2" automatically throws
300 user to editor for syntax error correction without prompting.
313 user to editor for syntax error correction without prompting.
301
314
302 2006-01-27 Ville Vainio <vivainio@gmail.com>
315 2006-01-27 Ville Vainio <vivainio@gmail.com>
303
316
304 * ipmaker.py: Give "realistic" sys.argv for scripts (without
317 * ipmaker.py: Give "realistic" sys.argv for scripts (without
305 'ipython' at argv[0]) executed through command line.
318 'ipython' at argv[0]) executed through command line.
306 NOTE: this DEPRECATES calling ipython with multiple scripts
319 NOTE: this DEPRECATES calling ipython with multiple scripts
307 ("ipython a.py b.py c.py")
320 ("ipython a.py b.py c.py")
308
321
309 * iplib.py, hooks.py: Added configurable input prefilter,
322 * iplib.py, hooks.py: Added configurable input prefilter,
310 named 'input_prefilter'. See ext_rescapture.py for example
323 named 'input_prefilter'. See ext_rescapture.py for example
311 usage.
324 usage.
312
325
313 * ext_rescapture.py, Magic.py: Better system command output capture
326 * ext_rescapture.py, Magic.py: Better system command output capture
314 through 'var = !ls' (deprecates user-visible %sc). Same notation
327 through 'var = !ls' (deprecates user-visible %sc). Same notation
315 applies for magics, 'var = %alias' assigns alias list to var.
328 applies for magics, 'var = %alias' assigns alias list to var.
316
329
317 * ipapi.py: added meta() for accessing extension-usable data store.
330 * ipapi.py: added meta() for accessing extension-usable data store.
318
331
319 * iplib.py: added InteractiveShell.getapi(). New magics should be
332 * iplib.py: added InteractiveShell.getapi(). New magics should be
320 written doing self.getapi() instead of using the shell directly.
333 written doing self.getapi() instead of using the shell directly.
321
334
322 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
335 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
323 %store foo >> ~/myfoo.txt to store variables to files (in clean
336 %store foo >> ~/myfoo.txt to store variables to files (in clean
324 textual form, not a restorable pickle).
337 textual form, not a restorable pickle).
325
338
326 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
339 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
327
340
328 * usage.py, Magic.py: added %quickref
341 * usage.py, Magic.py: added %quickref
329
342
330 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
343 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
331
344
332 * GetoptErrors when invoking magics etc. with wrong args
345 * GetoptErrors when invoking magics etc. with wrong args
333 are now more helpful:
346 are now more helpful:
334 GetoptError: option -l not recognized (allowed: "qb" )
347 GetoptError: option -l not recognized (allowed: "qb" )
335
348
336 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
349 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
337
350
338 * IPython/demo.py (Demo.show): Flush stdout after each block, so
351 * IPython/demo.py (Demo.show): Flush stdout after each block, so
339 computationally intensive blocks don't appear to stall the demo.
352 computationally intensive blocks don't appear to stall the demo.
340
353
341 2006-01-24 Ville Vainio <vivainio@gmail.com>
354 2006-01-24 Ville Vainio <vivainio@gmail.com>
342
355
343 * iplib.py, hooks.py: 'result_display' hook can return a non-None
356 * iplib.py, hooks.py: 'result_display' hook can return a non-None
344 value to manipulate resulting history entry.
357 value to manipulate resulting history entry.
345
358
346 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
359 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
347 to instance methods of IPApi class, to make extending an embedded
360 to instance methods of IPApi class, to make extending an embedded
348 IPython feasible. See ext_rehashdir.py for example usage.
361 IPython feasible. See ext_rehashdir.py for example usage.
349
362
350 * Merged 1071-1076 from banches/0.7.1
363 * Merged 1071-1076 from banches/0.7.1
351
364
352
365
353 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
366 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
354
367
355 * tools/release (daystamp): Fix build tools to use the new
368 * tools/release (daystamp): Fix build tools to use the new
356 eggsetup.py script to build lightweight eggs.
369 eggsetup.py script to build lightweight eggs.
357
370
358 * Applied changesets 1062 and 1064 before 0.7.1 release.
371 * Applied changesets 1062 and 1064 before 0.7.1 release.
359
372
360 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
373 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
361 see the raw input history (without conversions like %ls ->
374 see the raw input history (without conversions like %ls ->
362 ipmagic("ls")). After a request from W. Stein, SAGE
375 ipmagic("ls")). After a request from W. Stein, SAGE
363 (http://modular.ucsd.edu/sage) developer. This information is
376 (http://modular.ucsd.edu/sage) developer. This information is
364 stored in the input_hist_raw attribute of the IPython instance, so
377 stored in the input_hist_raw attribute of the IPython instance, so
365 developers can access it if needed (it's an InputList instance).
378 developers can access it if needed (it's an InputList instance).
366
379
367 * Versionstring = 0.7.2.svn
380 * Versionstring = 0.7.2.svn
368
381
369 * eggsetup.py: A separate script for constructing eggs, creates
382 * eggsetup.py: A separate script for constructing eggs, creates
370 proper launch scripts even on Windows (an .exe file in
383 proper launch scripts even on Windows (an .exe file in
371 \python24\scripts).
384 \python24\scripts).
372
385
373 * ipapi.py: launch_new_instance, launch entry point needed for the
386 * ipapi.py: launch_new_instance, launch entry point needed for the
374 egg.
387 egg.
375
388
376 2006-01-23 Ville Vainio <vivainio@gmail.com>
389 2006-01-23 Ville Vainio <vivainio@gmail.com>
377
390
378 * Added %cpaste magic for pasting python code
391 * Added %cpaste magic for pasting python code
379
392
380 2006-01-22 Ville Vainio <vivainio@gmail.com>
393 2006-01-22 Ville Vainio <vivainio@gmail.com>
381
394
382 * Merge from branches/0.7.1 into trunk, revs 1052-1057
395 * Merge from branches/0.7.1 into trunk, revs 1052-1057
383
396
384 * Versionstring = 0.7.2.svn
397 * Versionstring = 0.7.2.svn
385
398
386 * eggsetup.py: A separate script for constructing eggs, creates
399 * eggsetup.py: A separate script for constructing eggs, creates
387 proper launch scripts even on Windows (an .exe file in
400 proper launch scripts even on Windows (an .exe file in
388 \python24\scripts).
401 \python24\scripts).
389
402
390 * ipapi.py: launch_new_instance, launch entry point needed for the
403 * ipapi.py: launch_new_instance, launch entry point needed for the
391 egg.
404 egg.
392
405
393 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
406 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
394
407
395 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
408 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
396 %pfile foo would print the file for foo even if it was a binary.
409 %pfile foo would print the file for foo even if it was a binary.
397 Now, extensions '.so' and '.dll' are skipped.
410 Now, extensions '.so' and '.dll' are skipped.
398
411
399 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
412 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
400 bug, where macros would fail in all threaded modes. I'm not 100%
413 bug, where macros would fail in all threaded modes. I'm not 100%
401 sure, so I'm going to put out an rc instead of making a release
414 sure, so I'm going to put out an rc instead of making a release
402 today, and wait for feedback for at least a few days.
415 today, and wait for feedback for at least a few days.
403
416
404 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
417 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
405 it...) the handling of pasting external code with autoindent on.
418 it...) the handling of pasting external code with autoindent on.
406 To get out of a multiline input, the rule will appear for most
419 To get out of a multiline input, the rule will appear for most
407 users unchanged: two blank lines or change the indent level
420 users unchanged: two blank lines or change the indent level
408 proposed by IPython. But there is a twist now: you can
421 proposed by IPython. But there is a twist now: you can
409 add/subtract only *one or two spaces*. If you add/subtract three
422 add/subtract only *one or two spaces*. If you add/subtract three
410 or more (unless you completely delete the line), IPython will
423 or more (unless you completely delete the line), IPython will
411 accept that line, and you'll need to enter a second one of pure
424 accept that line, and you'll need to enter a second one of pure
412 whitespace. I know it sounds complicated, but I can't find a
425 whitespace. I know it sounds complicated, but I can't find a
413 different solution that covers all the cases, with the right
426 different solution that covers all the cases, with the right
414 heuristics. Hopefully in actual use, nobody will really notice
427 heuristics. Hopefully in actual use, nobody will really notice
415 all these strange rules and things will 'just work'.
428 all these strange rules and things will 'just work'.
416
429
417 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
430 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
418
431
419 * IPython/iplib.py (interact): catch exceptions which can be
432 * IPython/iplib.py (interact): catch exceptions which can be
420 triggered asynchronously by signal handlers. Thanks to an
433 triggered asynchronously by signal handlers. Thanks to an
421 automatic crash report, submitted by Colin Kingsley
434 automatic crash report, submitted by Colin Kingsley
422 <tercel-AT-gentoo.org>.
435 <tercel-AT-gentoo.org>.
423
436
424 2006-01-20 Ville Vainio <vivainio@gmail.com>
437 2006-01-20 Ville Vainio <vivainio@gmail.com>
425
438
426 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
439 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
427 (%rehashdir, very useful, try it out) of how to extend ipython
440 (%rehashdir, very useful, try it out) of how to extend ipython
428 with new magics. Also added Extensions dir to pythonpath to make
441 with new magics. Also added Extensions dir to pythonpath to make
429 importing extensions easy.
442 importing extensions easy.
430
443
431 * %store now complains when trying to store interactively declared
444 * %store now complains when trying to store interactively declared
432 classes / instances of those classes.
445 classes / instances of those classes.
433
446
434 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
447 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
435 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
448 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
436 if they exist, and ipy_user_conf.py with some defaults is created for
449 if they exist, and ipy_user_conf.py with some defaults is created for
437 the user.
450 the user.
438
451
439 * Startup rehashing done by the config file, not InterpreterExec.
452 * Startup rehashing done by the config file, not InterpreterExec.
440 This means system commands are available even without selecting the
453 This means system commands are available even without selecting the
441 pysh profile. It's the sensible default after all.
454 pysh profile. It's the sensible default after all.
442
455
443 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
456 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
444
457
445 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
458 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
446 multiline code with autoindent on working. But I am really not
459 multiline code with autoindent on working. But I am really not
447 sure, so this needs more testing. Will commit a debug-enabled
460 sure, so this needs more testing. Will commit a debug-enabled
448 version for now, while I test it some more, so that Ville and
461 version for now, while I test it some more, so that Ville and
449 others may also catch any problems. Also made
462 others may also catch any problems. Also made
450 self.indent_current_str() a method, to ensure that there's no
463 self.indent_current_str() a method, to ensure that there's no
451 chance of the indent space count and the corresponding string
464 chance of the indent space count and the corresponding string
452 falling out of sync. All code needing the string should just call
465 falling out of sync. All code needing the string should just call
453 the method.
466 the method.
454
467
455 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
468 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
456
469
457 * IPython/Magic.py (magic_edit): fix check for when users don't
470 * IPython/Magic.py (magic_edit): fix check for when users don't
458 save their output files, the try/except was in the wrong section.
471 save their output files, the try/except was in the wrong section.
459
472
460 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
473 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
461
474
462 * IPython/Magic.py (magic_run): fix __file__ global missing from
475 * IPython/Magic.py (magic_run): fix __file__ global missing from
463 script's namespace when executed via %run. After a report by
476 script's namespace when executed via %run. After a report by
464 Vivian.
477 Vivian.
465
478
466 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
479 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
467 when using python 2.4. The parent constructor changed in 2.4, and
480 when using python 2.4. The parent constructor changed in 2.4, and
468 we need to track it directly (we can't call it, as it messes up
481 we need to track it directly (we can't call it, as it messes up
469 readline and tab-completion inside our pdb would stop working).
482 readline and tab-completion inside our pdb would stop working).
470 After a bug report by R. Bernstein <rocky-AT-panix.com>.
483 After a bug report by R. Bernstein <rocky-AT-panix.com>.
471
484
472 2006-01-16 Ville Vainio <vivainio@gmail.com>
485 2006-01-16 Ville Vainio <vivainio@gmail.com>
473
486
474 * Ipython/magic.py:Reverted back to old %edit functionality
487 * Ipython/magic.py:Reverted back to old %edit functionality
475 that returns file contents on exit.
488 that returns file contents on exit.
476
489
477 * IPython/path.py: Added Jason Orendorff's "path" module to
490 * IPython/path.py: Added Jason Orendorff's "path" module to
478 IPython tree, http://www.jorendorff.com/articles/python/path/.
491 IPython tree, http://www.jorendorff.com/articles/python/path/.
479 You can get path objects conveniently through %sc, and !!, e.g.:
492 You can get path objects conveniently through %sc, and !!, e.g.:
480 sc files=ls
493 sc files=ls
481 for p in files.paths: # or files.p
494 for p in files.paths: # or files.p
482 print p,p.mtime
495 print p,p.mtime
483
496
484 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
497 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
485 now work again without considering the exclusion regexp -
498 now work again without considering the exclusion regexp -
486 hence, things like ',foo my/path' turn to 'foo("my/path")'
499 hence, things like ',foo my/path' turn to 'foo("my/path")'
487 instead of syntax error.
500 instead of syntax error.
488
501
489
502
490 2006-01-14 Ville Vainio <vivainio@gmail.com>
503 2006-01-14 Ville Vainio <vivainio@gmail.com>
491
504
492 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
505 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
493 ipapi decorators for python 2.4 users, options() provides access to rc
506 ipapi decorators for python 2.4 users, options() provides access to rc
494 data.
507 data.
495
508
496 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
509 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
497 as path separators (even on Linux ;-). Space character after
510 as path separators (even on Linux ;-). Space character after
498 backslash (as yielded by tab completer) is still space;
511 backslash (as yielded by tab completer) is still space;
499 "%cd long\ name" works as expected.
512 "%cd long\ name" works as expected.
500
513
501 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
514 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
502 as "chain of command", with priority. API stays the same,
515 as "chain of command", with priority. API stays the same,
503 TryNext exception raised by a hook function signals that
516 TryNext exception raised by a hook function signals that
504 current hook failed and next hook should try handling it, as
517 current hook failed and next hook should try handling it, as
505 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
518 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
506 requested configurable display hook, which is now implemented.
519 requested configurable display hook, which is now implemented.
507
520
508 2006-01-13 Ville Vainio <vivainio@gmail.com>
521 2006-01-13 Ville Vainio <vivainio@gmail.com>
509
522
510 * IPython/platutils*.py: platform specific utility functions,
523 * IPython/platutils*.py: platform specific utility functions,
511 so far only set_term_title is implemented (change terminal
524 so far only set_term_title is implemented (change terminal
512 label in windowing systems). %cd now changes the title to
525 label in windowing systems). %cd now changes the title to
513 current dir.
526 current dir.
514
527
515 * IPython/Release.py: Added myself to "authors" list,
528 * IPython/Release.py: Added myself to "authors" list,
516 had to create new files.
529 had to create new files.
517
530
518 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
531 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
519 shell escape; not a known bug but had potential to be one in the
532 shell escape; not a known bug but had potential to be one in the
520 future.
533 future.
521
534
522 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
535 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
523 extension API for IPython! See the module for usage example. Fix
536 extension API for IPython! See the module for usage example. Fix
524 OInspect for docstring-less magic functions.
537 OInspect for docstring-less magic functions.
525
538
526
539
527 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
540 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
528
541
529 * IPython/iplib.py (raw_input): temporarily deactivate all
542 * IPython/iplib.py (raw_input): temporarily deactivate all
530 attempts at allowing pasting of code with autoindent on. It
543 attempts at allowing pasting of code with autoindent on. It
531 introduced bugs (reported by Prabhu) and I can't seem to find a
544 introduced bugs (reported by Prabhu) and I can't seem to find a
532 robust combination which works in all cases. Will have to revisit
545 robust combination which works in all cases. Will have to revisit
533 later.
546 later.
534
547
535 * IPython/genutils.py: remove isspace() function. We've dropped
548 * IPython/genutils.py: remove isspace() function. We've dropped
536 2.2 compatibility, so it's OK to use the string method.
549 2.2 compatibility, so it's OK to use the string method.
537
550
538 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
551 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
539
552
540 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
553 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
541 matching what NOT to autocall on, to include all python binary
554 matching what NOT to autocall on, to include all python binary
542 operators (including things like 'and', 'or', 'is' and 'in').
555 operators (including things like 'and', 'or', 'is' and 'in').
543 Prompted by a bug report on 'foo & bar', but I realized we had
556 Prompted by a bug report on 'foo & bar', but I realized we had
544 many more potential bug cases with other operators. The regexp is
557 many more potential bug cases with other operators. The regexp is
545 self.re_exclude_auto, it's fairly commented.
558 self.re_exclude_auto, it's fairly commented.
546
559
547 2006-01-12 Ville Vainio <vivainio@gmail.com>
560 2006-01-12 Ville Vainio <vivainio@gmail.com>
548
561
549 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
562 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
550 Prettified and hardened string/backslash quoting with ipsystem(),
563 Prettified and hardened string/backslash quoting with ipsystem(),
551 ipalias() and ipmagic(). Now even \ characters are passed to
564 ipalias() and ipmagic(). Now even \ characters are passed to
552 %magics, !shell escapes and aliases exactly as they are in the
565 %magics, !shell escapes and aliases exactly as they are in the
553 ipython command line. Should improve backslash experience,
566 ipython command line. Should improve backslash experience,
554 particularly in Windows (path delimiter for some commands that
567 particularly in Windows (path delimiter for some commands that
555 won't understand '/'), but Unix benefits as well (regexps). %cd
568 won't understand '/'), but Unix benefits as well (regexps). %cd
556 magic still doesn't support backslash path delimiters, though. Also
569 magic still doesn't support backslash path delimiters, though. Also
557 deleted all pretense of supporting multiline command strings in
570 deleted all pretense of supporting multiline command strings in
558 !system or %magic commands. Thanks to Jerry McRae for suggestions.
571 !system or %magic commands. Thanks to Jerry McRae for suggestions.
559
572
560 * doc/build_doc_instructions.txt added. Documentation on how to
573 * doc/build_doc_instructions.txt added. Documentation on how to
561 use doc/update_manual.py, added yesterday. Both files contributed
574 use doc/update_manual.py, added yesterday. Both files contributed
562 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
575 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
563 doc/*.sh for deprecation at a later date.
576 doc/*.sh for deprecation at a later date.
564
577
565 * /ipython.py Added ipython.py to root directory for
578 * /ipython.py Added ipython.py to root directory for
566 zero-installation (tar xzvf ipython.tgz; cd ipython; python
579 zero-installation (tar xzvf ipython.tgz; cd ipython; python
567 ipython.py) and development convenience (no need to kee doing
580 ipython.py) and development convenience (no need to kee doing
568 "setup.py install" between changes).
581 "setup.py install" between changes).
569
582
570 * Made ! and !! shell escapes work (again) in multiline expressions:
583 * Made ! and !! shell escapes work (again) in multiline expressions:
571 if 1:
584 if 1:
572 !ls
585 !ls
573 !!ls
586 !!ls
574
587
575 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
588 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
576
589
577 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
590 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
578 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
591 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
579 module in case-insensitive installation. Was causing crashes
592 module in case-insensitive installation. Was causing crashes
580 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
593 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
581
594
582 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
595 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
583 <marienz-AT-gentoo.org>, closes
596 <marienz-AT-gentoo.org>, closes
584 http://www.scipy.net/roundup/ipython/issue51.
597 http://www.scipy.net/roundup/ipython/issue51.
585
598
586 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
599 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
587
600
588 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
601 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
589 problem of excessive CPU usage under *nix and keyboard lag under
602 problem of excessive CPU usage under *nix and keyboard lag under
590 win32.
603 win32.
591
604
592 2006-01-10 *** Released version 0.7.0
605 2006-01-10 *** Released version 0.7.0
593
606
594 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
607 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
595
608
596 * IPython/Release.py (revision): tag version number to 0.7.0,
609 * IPython/Release.py (revision): tag version number to 0.7.0,
597 ready for release.
610 ready for release.
598
611
599 * IPython/Magic.py (magic_edit): Add print statement to %edit so
612 * IPython/Magic.py (magic_edit): Add print statement to %edit so
600 it informs the user of the name of the temp. file used. This can
613 it informs the user of the name of the temp. file used. This can
601 help if you decide later to reuse that same file, so you know
614 help if you decide later to reuse that same file, so you know
602 where to copy the info from.
615 where to copy the info from.
603
616
604 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
617 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
605
618
606 * setup_bdist_egg.py: little script to build an egg. Added
619 * setup_bdist_egg.py: little script to build an egg. Added
607 support in the release tools as well.
620 support in the release tools as well.
608
621
609 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
622 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
610
623
611 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
624 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
612 version selection (new -wxversion command line and ipythonrc
625 version selection (new -wxversion command line and ipythonrc
613 parameter). Patch contributed by Arnd Baecker
626 parameter). Patch contributed by Arnd Baecker
614 <arnd.baecker-AT-web.de>.
627 <arnd.baecker-AT-web.de>.
615
628
616 * IPython/iplib.py (embed_mainloop): fix tab-completion in
629 * IPython/iplib.py (embed_mainloop): fix tab-completion in
617 embedded instances, for variables defined at the interactive
630 embedded instances, for variables defined at the interactive
618 prompt of the embedded ipython. Reported by Arnd.
631 prompt of the embedded ipython. Reported by Arnd.
619
632
620 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
633 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
621 it can be used as a (stateful) toggle, or with a direct parameter.
634 it can be used as a (stateful) toggle, or with a direct parameter.
622
635
623 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
636 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
624 could be triggered in certain cases and cause the traceback
637 could be triggered in certain cases and cause the traceback
625 printer not to work.
638 printer not to work.
626
639
627 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
640 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
628
641
629 * IPython/iplib.py (_should_recompile): Small fix, closes
642 * IPython/iplib.py (_should_recompile): Small fix, closes
630 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
643 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
631
644
632 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
645 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
633
646
634 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
647 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
635 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
648 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
636 Moad for help with tracking it down.
649 Moad for help with tracking it down.
637
650
638 * IPython/iplib.py (handle_auto): fix autocall handling for
651 * IPython/iplib.py (handle_auto): fix autocall handling for
639 objects which support BOTH __getitem__ and __call__ (so that f [x]
652 objects which support BOTH __getitem__ and __call__ (so that f [x]
640 is left alone, instead of becoming f([x]) automatically).
653 is left alone, instead of becoming f([x]) automatically).
641
654
642 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
655 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
643 Ville's patch.
656 Ville's patch.
644
657
645 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
658 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
646
659
647 * IPython/iplib.py (handle_auto): changed autocall semantics to
660 * IPython/iplib.py (handle_auto): changed autocall semantics to
648 include 'smart' mode, where the autocall transformation is NOT
661 include 'smart' mode, where the autocall transformation is NOT
649 applied if there are no arguments on the line. This allows you to
662 applied if there are no arguments on the line. This allows you to
650 just type 'foo' if foo is a callable to see its internal form,
663 just type 'foo' if foo is a callable to see its internal form,
651 instead of having it called with no arguments (typically a
664 instead of having it called with no arguments (typically a
652 mistake). The old 'full' autocall still exists: for that, you
665 mistake). The old 'full' autocall still exists: for that, you
653 need to set the 'autocall' parameter to 2 in your ipythonrc file.
666 need to set the 'autocall' parameter to 2 in your ipythonrc file.
654
667
655 * IPython/completer.py (Completer.attr_matches): add
668 * IPython/completer.py (Completer.attr_matches): add
656 tab-completion support for Enthoughts' traits. After a report by
669 tab-completion support for Enthoughts' traits. After a report by
657 Arnd and a patch by Prabhu.
670 Arnd and a patch by Prabhu.
658
671
659 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
672 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
660
673
661 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
674 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
662 Schmolck's patch to fix inspect.getinnerframes().
675 Schmolck's patch to fix inspect.getinnerframes().
663
676
664 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
677 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
665 for embedded instances, regarding handling of namespaces and items
678 for embedded instances, regarding handling of namespaces and items
666 added to the __builtin__ one. Multiple embedded instances and
679 added to the __builtin__ one. Multiple embedded instances and
667 recursive embeddings should work better now (though I'm not sure
680 recursive embeddings should work better now (though I'm not sure
668 I've got all the corner cases fixed, that code is a bit of a brain
681 I've got all the corner cases fixed, that code is a bit of a brain
669 twister).
682 twister).
670
683
671 * IPython/Magic.py (magic_edit): added support to edit in-memory
684 * IPython/Magic.py (magic_edit): added support to edit in-memory
672 macros (automatically creates the necessary temp files). %edit
685 macros (automatically creates the necessary temp files). %edit
673 also doesn't return the file contents anymore, it's just noise.
686 also doesn't return the file contents anymore, it's just noise.
674
687
675 * IPython/completer.py (Completer.attr_matches): revert change to
688 * IPython/completer.py (Completer.attr_matches): revert change to
676 complete only on attributes listed in __all__. I realized it
689 complete only on attributes listed in __all__. I realized it
677 cripples the tab-completion system as a tool for exploring the
690 cripples the tab-completion system as a tool for exploring the
678 internals of unknown libraries (it renders any non-__all__
691 internals of unknown libraries (it renders any non-__all__
679 attribute off-limits). I got bit by this when trying to see
692 attribute off-limits). I got bit by this when trying to see
680 something inside the dis module.
693 something inside the dis module.
681
694
682 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
695 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
683
696
684 * IPython/iplib.py (InteractiveShell.__init__): add .meta
697 * IPython/iplib.py (InteractiveShell.__init__): add .meta
685 namespace for users and extension writers to hold data in. This
698 namespace for users and extension writers to hold data in. This
686 follows the discussion in
699 follows the discussion in
687 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
700 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
688
701
689 * IPython/completer.py (IPCompleter.complete): small patch to help
702 * IPython/completer.py (IPCompleter.complete): small patch to help
690 tab-completion under Emacs, after a suggestion by John Barnard
703 tab-completion under Emacs, after a suggestion by John Barnard
691 <barnarj-AT-ccf.org>.
704 <barnarj-AT-ccf.org>.
692
705
693 * IPython/Magic.py (Magic.extract_input_slices): added support for
706 * IPython/Magic.py (Magic.extract_input_slices): added support for
694 the slice notation in magics to use N-M to represent numbers N...M
707 the slice notation in magics to use N-M to represent numbers N...M
695 (closed endpoints). This is used by %macro and %save.
708 (closed endpoints). This is used by %macro and %save.
696
709
697 * IPython/completer.py (Completer.attr_matches): for modules which
710 * IPython/completer.py (Completer.attr_matches): for modules which
698 define __all__, complete only on those. After a patch by Jeffrey
711 define __all__, complete only on those. After a patch by Jeffrey
699 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
712 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
700 speed up this routine.
713 speed up this routine.
701
714
702 * IPython/Logger.py (Logger.log): fix a history handling bug. I
715 * IPython/Logger.py (Logger.log): fix a history handling bug. I
703 don't know if this is the end of it, but the behavior now is
716 don't know if this is the end of it, but the behavior now is
704 certainly much more correct. Note that coupled with macros,
717 certainly much more correct. Note that coupled with macros,
705 slightly surprising (at first) behavior may occur: a macro will in
718 slightly surprising (at first) behavior may occur: a macro will in
706 general expand to multiple lines of input, so upon exiting, the
719 general expand to multiple lines of input, so upon exiting, the
707 in/out counters will both be bumped by the corresponding amount
720 in/out counters will both be bumped by the corresponding amount
708 (as if the macro's contents had been typed interactively). Typing
721 (as if the macro's contents had been typed interactively). Typing
709 %hist will reveal the intermediate (silently processed) lines.
722 %hist will reveal the intermediate (silently processed) lines.
710
723
711 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
724 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
712 pickle to fail (%run was overwriting __main__ and not restoring
725 pickle to fail (%run was overwriting __main__ and not restoring
713 it, but pickle relies on __main__ to operate).
726 it, but pickle relies on __main__ to operate).
714
727
715 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
728 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
716 using properties, but forgot to make the main InteractiveShell
729 using properties, but forgot to make the main InteractiveShell
717 class a new-style class. Properties fail silently, and
730 class a new-style class. Properties fail silently, and
718 misteriously, with old-style class (getters work, but
731 misteriously, with old-style class (getters work, but
719 setters don't do anything).
732 setters don't do anything).
720
733
721 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
734 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
722
735
723 * IPython/Magic.py (magic_history): fix history reporting bug (I
736 * IPython/Magic.py (magic_history): fix history reporting bug (I
724 know some nasties are still there, I just can't seem to find a
737 know some nasties are still there, I just can't seem to find a
725 reproducible test case to track them down; the input history is
738 reproducible test case to track them down; the input history is
726 falling out of sync...)
739 falling out of sync...)
727
740
728 * IPython/iplib.py (handle_shell_escape): fix bug where both
741 * IPython/iplib.py (handle_shell_escape): fix bug where both
729 aliases and system accesses where broken for indented code (such
742 aliases and system accesses where broken for indented code (such
730 as loops).
743 as loops).
731
744
732 * IPython/genutils.py (shell): fix small but critical bug for
745 * IPython/genutils.py (shell): fix small but critical bug for
733 win32 system access.
746 win32 system access.
734
747
735 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
748 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
736
749
737 * IPython/iplib.py (showtraceback): remove use of the
750 * IPython/iplib.py (showtraceback): remove use of the
738 sys.last_{type/value/traceback} structures, which are non
751 sys.last_{type/value/traceback} structures, which are non
739 thread-safe.
752 thread-safe.
740 (_prefilter): change control flow to ensure that we NEVER
753 (_prefilter): change control flow to ensure that we NEVER
741 introspect objects when autocall is off. This will guarantee that
754 introspect objects when autocall is off. This will guarantee that
742 having an input line of the form 'x.y', where access to attribute
755 having an input line of the form 'x.y', where access to attribute
743 'y' has side effects, doesn't trigger the side effect TWICE. It
756 'y' has side effects, doesn't trigger the side effect TWICE. It
744 is important to note that, with autocall on, these side effects
757 is important to note that, with autocall on, these side effects
745 can still happen.
758 can still happen.
746 (ipsystem): new builtin, to complete the ip{magic/alias/system}
759 (ipsystem): new builtin, to complete the ip{magic/alias/system}
747 trio. IPython offers these three kinds of special calls which are
760 trio. IPython offers these three kinds of special calls which are
748 not python code, and it's a good thing to have their call method
761 not python code, and it's a good thing to have their call method
749 be accessible as pure python functions (not just special syntax at
762 be accessible as pure python functions (not just special syntax at
750 the command line). It gives us a better internal implementation
763 the command line). It gives us a better internal implementation
751 structure, as well as exposing these for user scripting more
764 structure, as well as exposing these for user scripting more
752 cleanly.
765 cleanly.
753
766
754 * IPython/macro.py (Macro.__init__): moved macros to a standalone
767 * IPython/macro.py (Macro.__init__): moved macros to a standalone
755 file. Now that they'll be more likely to be used with the
768 file. Now that they'll be more likely to be used with the
756 persistance system (%store), I want to make sure their module path
769 persistance system (%store), I want to make sure their module path
757 doesn't change in the future, so that we don't break things for
770 doesn't change in the future, so that we don't break things for
758 users' persisted data.
771 users' persisted data.
759
772
760 * IPython/iplib.py (autoindent_update): move indentation
773 * IPython/iplib.py (autoindent_update): move indentation
761 management into the _text_ processing loop, not the keyboard
774 management into the _text_ processing loop, not the keyboard
762 interactive one. This is necessary to correctly process non-typed
775 interactive one. This is necessary to correctly process non-typed
763 multiline input (such as macros).
776 multiline input (such as macros).
764
777
765 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
778 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
766 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
779 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
767 which was producing problems in the resulting manual.
780 which was producing problems in the resulting manual.
768 (magic_whos): improve reporting of instances (show their class,
781 (magic_whos): improve reporting of instances (show their class,
769 instead of simply printing 'instance' which isn't terribly
782 instead of simply printing 'instance' which isn't terribly
770 informative).
783 informative).
771
784
772 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
785 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
773 (minor mods) to support network shares under win32.
786 (minor mods) to support network shares under win32.
774
787
775 * IPython/winconsole.py (get_console_size): add new winconsole
788 * IPython/winconsole.py (get_console_size): add new winconsole
776 module and fixes to page_dumb() to improve its behavior under
789 module and fixes to page_dumb() to improve its behavior under
777 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
790 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
778
791
779 * IPython/Magic.py (Macro): simplified Macro class to just
792 * IPython/Magic.py (Macro): simplified Macro class to just
780 subclass list. We've had only 2.2 compatibility for a very long
793 subclass list. We've had only 2.2 compatibility for a very long
781 time, yet I was still avoiding subclassing the builtin types. No
794 time, yet I was still avoiding subclassing the builtin types. No
782 more (I'm also starting to use properties, though I won't shift to
795 more (I'm also starting to use properties, though I won't shift to
783 2.3-specific features quite yet).
796 2.3-specific features quite yet).
784 (magic_store): added Ville's patch for lightweight variable
797 (magic_store): added Ville's patch for lightweight variable
785 persistence, after a request on the user list by Matt Wilkie
798 persistence, after a request on the user list by Matt Wilkie
786 <maphew-AT-gmail.com>. The new %store magic's docstring has full
799 <maphew-AT-gmail.com>. The new %store magic's docstring has full
787 details.
800 details.
788
801
789 * IPython/iplib.py (InteractiveShell.post_config_initialization):
802 * IPython/iplib.py (InteractiveShell.post_config_initialization):
790 changed the default logfile name from 'ipython.log' to
803 changed the default logfile name from 'ipython.log' to
791 'ipython_log.py'. These logs are real python files, and now that
804 'ipython_log.py'. These logs are real python files, and now that
792 we have much better multiline support, people are more likely to
805 we have much better multiline support, people are more likely to
793 want to use them as such. Might as well name them correctly.
806 want to use them as such. Might as well name them correctly.
794
807
795 * IPython/Magic.py: substantial cleanup. While we can't stop
808 * IPython/Magic.py: substantial cleanup. While we can't stop
796 using magics as mixins, due to the existing customizations 'out
809 using magics as mixins, due to the existing customizations 'out
797 there' which rely on the mixin naming conventions, at least I
810 there' which rely on the mixin naming conventions, at least I
798 cleaned out all cross-class name usage. So once we are OK with
811 cleaned out all cross-class name usage. So once we are OK with
799 breaking compatibility, the two systems can be separated.
812 breaking compatibility, the two systems can be separated.
800
813
801 * IPython/Logger.py: major cleanup. This one is NOT a mixin
814 * IPython/Logger.py: major cleanup. This one is NOT a mixin
802 anymore, and the class is a fair bit less hideous as well. New
815 anymore, and the class is a fair bit less hideous as well. New
803 features were also introduced: timestamping of input, and logging
816 features were also introduced: timestamping of input, and logging
804 of output results. These are user-visible with the -t and -o
817 of output results. These are user-visible with the -t and -o
805 options to %logstart. Closes
818 options to %logstart. Closes
806 http://www.scipy.net/roundup/ipython/issue11 and a request by
819 http://www.scipy.net/roundup/ipython/issue11 and a request by
807 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
820 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
808
821
809 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
822 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
810
823
811 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
824 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
812 better hadnle backslashes in paths. See the thread 'More Windows
825 better hadnle backslashes in paths. See the thread 'More Windows
813 questions part 2 - \/ characters revisited' on the iypthon user
826 questions part 2 - \/ characters revisited' on the iypthon user
814 list:
827 list:
815 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
828 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
816
829
817 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
830 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
818
831
819 (InteractiveShell.__init__): change threaded shells to not use the
832 (InteractiveShell.__init__): change threaded shells to not use the
820 ipython crash handler. This was causing more problems than not,
833 ipython crash handler. This was causing more problems than not,
821 as exceptions in the main thread (GUI code, typically) would
834 as exceptions in the main thread (GUI code, typically) would
822 always show up as a 'crash', when they really weren't.
835 always show up as a 'crash', when they really weren't.
823
836
824 The colors and exception mode commands (%colors/%xmode) have been
837 The colors and exception mode commands (%colors/%xmode) have been
825 synchronized to also take this into account, so users can get
838 synchronized to also take this into account, so users can get
826 verbose exceptions for their threaded code as well. I also added
839 verbose exceptions for their threaded code as well. I also added
827 support for activating pdb inside this exception handler as well,
840 support for activating pdb inside this exception handler as well,
828 so now GUI authors can use IPython's enhanced pdb at runtime.
841 so now GUI authors can use IPython's enhanced pdb at runtime.
829
842
830 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
843 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
831 true by default, and add it to the shipped ipythonrc file. Since
844 true by default, and add it to the shipped ipythonrc file. Since
832 this asks the user before proceeding, I think it's OK to make it
845 this asks the user before proceeding, I think it's OK to make it
833 true by default.
846 true by default.
834
847
835 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
848 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
836 of the previous special-casing of input in the eval loop. I think
849 of the previous special-casing of input in the eval loop. I think
837 this is cleaner, as they really are commands and shouldn't have
850 this is cleaner, as they really are commands and shouldn't have
838 a special role in the middle of the core code.
851 a special role in the middle of the core code.
839
852
840 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
853 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
841
854
842 * IPython/iplib.py (edit_syntax_error): added support for
855 * IPython/iplib.py (edit_syntax_error): added support for
843 automatically reopening the editor if the file had a syntax error
856 automatically reopening the editor if the file had a syntax error
844 in it. Thanks to scottt who provided the patch at:
857 in it. Thanks to scottt who provided the patch at:
845 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
858 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
846 version committed).
859 version committed).
847
860
848 * IPython/iplib.py (handle_normal): add suport for multi-line
861 * IPython/iplib.py (handle_normal): add suport for multi-line
849 input with emtpy lines. This fixes
862 input with emtpy lines. This fixes
850 http://www.scipy.net/roundup/ipython/issue43 and a similar
863 http://www.scipy.net/roundup/ipython/issue43 and a similar
851 discussion on the user list.
864 discussion on the user list.
852
865
853 WARNING: a behavior change is necessarily introduced to support
866 WARNING: a behavior change is necessarily introduced to support
854 blank lines: now a single blank line with whitespace does NOT
867 blank lines: now a single blank line with whitespace does NOT
855 break the input loop, which means that when autoindent is on, by
868 break the input loop, which means that when autoindent is on, by
856 default hitting return on the next (indented) line does NOT exit.
869 default hitting return on the next (indented) line does NOT exit.
857
870
858 Instead, to exit a multiline input you can either have:
871 Instead, to exit a multiline input you can either have:
859
872
860 - TWO whitespace lines (just hit return again), or
873 - TWO whitespace lines (just hit return again), or
861 - a single whitespace line of a different length than provided
874 - a single whitespace line of a different length than provided
862 by the autoindent (add or remove a space).
875 by the autoindent (add or remove a space).
863
876
864 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
877 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
865 module to better organize all readline-related functionality.
878 module to better organize all readline-related functionality.
866 I've deleted FlexCompleter and put all completion clases here.
879 I've deleted FlexCompleter and put all completion clases here.
867
880
868 * IPython/iplib.py (raw_input): improve indentation management.
881 * IPython/iplib.py (raw_input): improve indentation management.
869 It is now possible to paste indented code with autoindent on, and
882 It is now possible to paste indented code with autoindent on, and
870 the code is interpreted correctly (though it still looks bad on
883 the code is interpreted correctly (though it still looks bad on
871 screen, due to the line-oriented nature of ipython).
884 screen, due to the line-oriented nature of ipython).
872 (MagicCompleter.complete): change behavior so that a TAB key on an
885 (MagicCompleter.complete): change behavior so that a TAB key on an
873 otherwise empty line actually inserts a tab, instead of completing
886 otherwise empty line actually inserts a tab, instead of completing
874 on the entire global namespace. This makes it easier to use the
887 on the entire global namespace. This makes it easier to use the
875 TAB key for indentation. After a request by Hans Meine
888 TAB key for indentation. After a request by Hans Meine
876 <hans_meine-AT-gmx.net>
889 <hans_meine-AT-gmx.net>
877 (_prefilter): add support so that typing plain 'exit' or 'quit'
890 (_prefilter): add support so that typing plain 'exit' or 'quit'
878 does a sensible thing. Originally I tried to deviate as little as
891 does a sensible thing. Originally I tried to deviate as little as
879 possible from the default python behavior, but even that one may
892 possible from the default python behavior, but even that one may
880 change in this direction (thread on python-dev to that effect).
893 change in this direction (thread on python-dev to that effect).
881 Regardless, ipython should do the right thing even if CPython's
894 Regardless, ipython should do the right thing even if CPython's
882 '>>>' prompt doesn't.
895 '>>>' prompt doesn't.
883 (InteractiveShell): removed subclassing code.InteractiveConsole
896 (InteractiveShell): removed subclassing code.InteractiveConsole
884 class. By now we'd overridden just about all of its methods: I've
897 class. By now we'd overridden just about all of its methods: I've
885 copied the remaining two over, and now ipython is a standalone
898 copied the remaining two over, and now ipython is a standalone
886 class. This will provide a clearer picture for the chainsaw
899 class. This will provide a clearer picture for the chainsaw
887 branch refactoring.
900 branch refactoring.
888
901
889 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
902 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
890
903
891 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
904 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
892 failures for objects which break when dir() is called on them.
905 failures for objects which break when dir() is called on them.
893
906
894 * IPython/FlexCompleter.py (Completer.__init__): Added support for
907 * IPython/FlexCompleter.py (Completer.__init__): Added support for
895 distinct local and global namespaces in the completer API. This
908 distinct local and global namespaces in the completer API. This
896 change allows us top properly handle completion with distinct
909 change allows us top properly handle completion with distinct
897 scopes, including in embedded instances (this had never really
910 scopes, including in embedded instances (this had never really
898 worked correctly).
911 worked correctly).
899
912
900 Note: this introduces a change in the constructor for
913 Note: this introduces a change in the constructor for
901 MagicCompleter, as a new global_namespace parameter is now the
914 MagicCompleter, as a new global_namespace parameter is now the
902 second argument (the others were bumped one position).
915 second argument (the others were bumped one position).
903
916
904 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
917 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
905
918
906 * IPython/iplib.py (embed_mainloop): fix tab-completion in
919 * IPython/iplib.py (embed_mainloop): fix tab-completion in
907 embedded instances (which can be done now thanks to Vivian's
920 embedded instances (which can be done now thanks to Vivian's
908 frame-handling fixes for pdb).
921 frame-handling fixes for pdb).
909 (InteractiveShell.__init__): Fix namespace handling problem in
922 (InteractiveShell.__init__): Fix namespace handling problem in
910 embedded instances. We were overwriting __main__ unconditionally,
923 embedded instances. We were overwriting __main__ unconditionally,
911 and this should only be done for 'full' (non-embedded) IPython;
924 and this should only be done for 'full' (non-embedded) IPython;
912 embedded instances must respect the caller's __main__. Thanks to
925 embedded instances must respect the caller's __main__. Thanks to
913 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
926 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
914
927
915 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
928 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
916
929
917 * setup.py: added download_url to setup(). This registers the
930 * setup.py: added download_url to setup(). This registers the
918 download address at PyPI, which is not only useful to humans
931 download address at PyPI, which is not only useful to humans
919 browsing the site, but is also picked up by setuptools (the Eggs
932 browsing the site, but is also picked up by setuptools (the Eggs
920 machinery). Thanks to Ville and R. Kern for the info/discussion
933 machinery). Thanks to Ville and R. Kern for the info/discussion
921 on this.
934 on this.
922
935
923 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
936 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
924
937
925 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
938 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
926 This brings a lot of nice functionality to the pdb mode, which now
939 This brings a lot of nice functionality to the pdb mode, which now
927 has tab-completion, syntax highlighting, and better stack handling
940 has tab-completion, syntax highlighting, and better stack handling
928 than before. Many thanks to Vivian De Smedt
941 than before. Many thanks to Vivian De Smedt
929 <vivian-AT-vdesmedt.com> for the original patches.
942 <vivian-AT-vdesmedt.com> for the original patches.
930
943
931 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
944 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
932
945
933 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
946 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
934 sequence to consistently accept the banner argument. The
947 sequence to consistently accept the banner argument. The
935 inconsistency was tripping SAGE, thanks to Gary Zablackis
948 inconsistency was tripping SAGE, thanks to Gary Zablackis
936 <gzabl-AT-yahoo.com> for the report.
949 <gzabl-AT-yahoo.com> for the report.
937
950
938 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
951 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
939
952
940 * IPython/iplib.py (InteractiveShell.post_config_initialization):
953 * IPython/iplib.py (InteractiveShell.post_config_initialization):
941 Fix bug where a naked 'alias' call in the ipythonrc file would
954 Fix bug where a naked 'alias' call in the ipythonrc file would
942 cause a crash. Bug reported by Jorgen Stenarson.
955 cause a crash. Bug reported by Jorgen Stenarson.
943
956
944 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
957 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
945
958
946 * IPython/ipmaker.py (make_IPython): cleanups which should improve
959 * IPython/ipmaker.py (make_IPython): cleanups which should improve
947 startup time.
960 startup time.
948
961
949 * IPython/iplib.py (runcode): my globals 'fix' for embedded
962 * IPython/iplib.py (runcode): my globals 'fix' for embedded
950 instances had introduced a bug with globals in normal code. Now
963 instances had introduced a bug with globals in normal code. Now
951 it's working in all cases.
964 it's working in all cases.
952
965
953 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
966 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
954 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
967 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
955 has been introduced to set the default case sensitivity of the
968 has been introduced to set the default case sensitivity of the
956 searches. Users can still select either mode at runtime on a
969 searches. Users can still select either mode at runtime on a
957 per-search basis.
970 per-search basis.
958
971
959 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
972 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
960
973
961 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
974 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
962 attributes in wildcard searches for subclasses. Modified version
975 attributes in wildcard searches for subclasses. Modified version
963 of a patch by Jorgen.
976 of a patch by Jorgen.
964
977
965 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
978 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
966
979
967 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
980 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
968 embedded instances. I added a user_global_ns attribute to the
981 embedded instances. I added a user_global_ns attribute to the
969 InteractiveShell class to handle this.
982 InteractiveShell class to handle this.
970
983
971 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
984 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
972
985
973 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
986 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
974 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
987 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
975 (reported under win32, but may happen also in other platforms).
988 (reported under win32, but may happen also in other platforms).
976 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
989 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
977
990
978 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
991 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
979
992
980 * IPython/Magic.py (magic_psearch): new support for wildcard
993 * IPython/Magic.py (magic_psearch): new support for wildcard
981 patterns. Now, typing ?a*b will list all names which begin with a
994 patterns. Now, typing ?a*b will list all names which begin with a
982 and end in b, for example. The %psearch magic has full
995 and end in b, for example. The %psearch magic has full
983 docstrings. Many thanks to JΓΆrgen Stenarson
996 docstrings. Many thanks to JΓΆrgen Stenarson
984 <jorgen.stenarson-AT-bostream.nu>, author of the patches
997 <jorgen.stenarson-AT-bostream.nu>, author of the patches
985 implementing this functionality.
998 implementing this functionality.
986
999
987 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1000 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
988
1001
989 * Manual: fixed long-standing annoyance of double-dashes (as in
1002 * Manual: fixed long-standing annoyance of double-dashes (as in
990 --prefix=~, for example) being stripped in the HTML version. This
1003 --prefix=~, for example) being stripped in the HTML version. This
991 is a latex2html bug, but a workaround was provided. Many thanks
1004 is a latex2html bug, but a workaround was provided. Many thanks
992 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1005 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
993 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1006 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
994 rolling. This seemingly small issue had tripped a number of users
1007 rolling. This seemingly small issue had tripped a number of users
995 when first installing, so I'm glad to see it gone.
1008 when first installing, so I'm glad to see it gone.
996
1009
997 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1010 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
998
1011
999 * IPython/Extensions/numeric_formats.py: fix missing import,
1012 * IPython/Extensions/numeric_formats.py: fix missing import,
1000 reported by Stephen Walton.
1013 reported by Stephen Walton.
1001
1014
1002 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1015 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1003
1016
1004 * IPython/demo.py: finish demo module, fully documented now.
1017 * IPython/demo.py: finish demo module, fully documented now.
1005
1018
1006 * IPython/genutils.py (file_read): simple little utility to read a
1019 * IPython/genutils.py (file_read): simple little utility to read a
1007 file and ensure it's closed afterwards.
1020 file and ensure it's closed afterwards.
1008
1021
1009 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1022 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1010
1023
1011 * IPython/demo.py (Demo.__init__): added support for individually
1024 * IPython/demo.py (Demo.__init__): added support for individually
1012 tagging blocks for automatic execution.
1025 tagging blocks for automatic execution.
1013
1026
1014 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1027 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1015 syntax-highlighted python sources, requested by John.
1028 syntax-highlighted python sources, requested by John.
1016
1029
1017 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1030 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1018
1031
1019 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1032 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1020 finishing.
1033 finishing.
1021
1034
1022 * IPython/genutils.py (shlex_split): moved from Magic to here,
1035 * IPython/genutils.py (shlex_split): moved from Magic to here,
1023 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1036 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1024
1037
1025 * IPython/demo.py (Demo.__init__): added support for silent
1038 * IPython/demo.py (Demo.__init__): added support for silent
1026 blocks, improved marks as regexps, docstrings written.
1039 blocks, improved marks as regexps, docstrings written.
1027 (Demo.__init__): better docstring, added support for sys.argv.
1040 (Demo.__init__): better docstring, added support for sys.argv.
1028
1041
1029 * IPython/genutils.py (marquee): little utility used by the demo
1042 * IPython/genutils.py (marquee): little utility used by the demo
1030 code, handy in general.
1043 code, handy in general.
1031
1044
1032 * IPython/demo.py (Demo.__init__): new class for interactive
1045 * IPython/demo.py (Demo.__init__): new class for interactive
1033 demos. Not documented yet, I just wrote it in a hurry for
1046 demos. Not documented yet, I just wrote it in a hurry for
1034 scipy'05. Will docstring later.
1047 scipy'05. Will docstring later.
1035
1048
1036 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1049 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1037
1050
1038 * IPython/Shell.py (sigint_handler): Drastic simplification which
1051 * IPython/Shell.py (sigint_handler): Drastic simplification which
1039 also seems to make Ctrl-C work correctly across threads! This is
1052 also seems to make Ctrl-C work correctly across threads! This is
1040 so simple, that I can't beleive I'd missed it before. Needs more
1053 so simple, that I can't beleive I'd missed it before. Needs more
1041 testing, though.
1054 testing, though.
1042 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1055 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1043 like this before...
1056 like this before...
1044
1057
1045 * IPython/genutils.py (get_home_dir): add protection against
1058 * IPython/genutils.py (get_home_dir): add protection against
1046 non-dirs in win32 registry.
1059 non-dirs in win32 registry.
1047
1060
1048 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1061 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1049 bug where dict was mutated while iterating (pysh crash).
1062 bug where dict was mutated while iterating (pysh crash).
1050
1063
1051 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1064 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1052
1065
1053 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1066 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1054 spurious newlines added by this routine. After a report by
1067 spurious newlines added by this routine. After a report by
1055 F. Mantegazza.
1068 F. Mantegazza.
1056
1069
1057 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1070 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1058
1071
1059 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1072 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1060 calls. These were a leftover from the GTK 1.x days, and can cause
1073 calls. These were a leftover from the GTK 1.x days, and can cause
1061 problems in certain cases (after a report by John Hunter).
1074 problems in certain cases (after a report by John Hunter).
1062
1075
1063 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1076 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1064 os.getcwd() fails at init time. Thanks to patch from David Remahl
1077 os.getcwd() fails at init time. Thanks to patch from David Remahl
1065 <chmod007-AT-mac.com>.
1078 <chmod007-AT-mac.com>.
1066 (InteractiveShell.__init__): prevent certain special magics from
1079 (InteractiveShell.__init__): prevent certain special magics from
1067 being shadowed by aliases. Closes
1080 being shadowed by aliases. Closes
1068 http://www.scipy.net/roundup/ipython/issue41.
1081 http://www.scipy.net/roundup/ipython/issue41.
1069
1082
1070 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1083 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1071
1084
1072 * IPython/iplib.py (InteractiveShell.complete): Added new
1085 * IPython/iplib.py (InteractiveShell.complete): Added new
1073 top-level completion method to expose the completion mechanism
1086 top-level completion method to expose the completion mechanism
1074 beyond readline-based environments.
1087 beyond readline-based environments.
1075
1088
1076 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1089 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1077
1090
1078 * tools/ipsvnc (svnversion): fix svnversion capture.
1091 * tools/ipsvnc (svnversion): fix svnversion capture.
1079
1092
1080 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1093 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1081 attribute to self, which was missing. Before, it was set by a
1094 attribute to self, which was missing. Before, it was set by a
1082 routine which in certain cases wasn't being called, so the
1095 routine which in certain cases wasn't being called, so the
1083 instance could end up missing the attribute. This caused a crash.
1096 instance could end up missing the attribute. This caused a crash.
1084 Closes http://www.scipy.net/roundup/ipython/issue40.
1097 Closes http://www.scipy.net/roundup/ipython/issue40.
1085
1098
1086 2005-08-16 Fernando Perez <fperez@colorado.edu>
1099 2005-08-16 Fernando Perez <fperez@colorado.edu>
1087
1100
1088 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1101 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1089 contains non-string attribute. Closes
1102 contains non-string attribute. Closes
1090 http://www.scipy.net/roundup/ipython/issue38.
1103 http://www.scipy.net/roundup/ipython/issue38.
1091
1104
1092 2005-08-14 Fernando Perez <fperez@colorado.edu>
1105 2005-08-14 Fernando Perez <fperez@colorado.edu>
1093
1106
1094 * tools/ipsvnc: Minor improvements, to add changeset info.
1107 * tools/ipsvnc: Minor improvements, to add changeset info.
1095
1108
1096 2005-08-12 Fernando Perez <fperez@colorado.edu>
1109 2005-08-12 Fernando Perez <fperez@colorado.edu>
1097
1110
1098 * IPython/iplib.py (runsource): remove self.code_to_run_src
1111 * IPython/iplib.py (runsource): remove self.code_to_run_src
1099 attribute. I realized this is nothing more than
1112 attribute. I realized this is nothing more than
1100 '\n'.join(self.buffer), and having the same data in two different
1113 '\n'.join(self.buffer), and having the same data in two different
1101 places is just asking for synchronization bugs. This may impact
1114 places is just asking for synchronization bugs. This may impact
1102 people who have custom exception handlers, so I need to warn
1115 people who have custom exception handlers, so I need to warn
1103 ipython-dev about it (F. Mantegazza may use them).
1116 ipython-dev about it (F. Mantegazza may use them).
1104
1117
1105 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1118 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1106
1119
1107 * IPython/genutils.py: fix 2.2 compatibility (generators)
1120 * IPython/genutils.py: fix 2.2 compatibility (generators)
1108
1121
1109 2005-07-18 Fernando Perez <fperez@colorado.edu>
1122 2005-07-18 Fernando Perez <fperez@colorado.edu>
1110
1123
1111 * IPython/genutils.py (get_home_dir): fix to help users with
1124 * IPython/genutils.py (get_home_dir): fix to help users with
1112 invalid $HOME under win32.
1125 invalid $HOME under win32.
1113
1126
1114 2005-07-17 Fernando Perez <fperez@colorado.edu>
1127 2005-07-17 Fernando Perez <fperez@colorado.edu>
1115
1128
1116 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1129 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1117 some old hacks and clean up a bit other routines; code should be
1130 some old hacks and clean up a bit other routines; code should be
1118 simpler and a bit faster.
1131 simpler and a bit faster.
1119
1132
1120 * IPython/iplib.py (interact): removed some last-resort attempts
1133 * IPython/iplib.py (interact): removed some last-resort attempts
1121 to survive broken stdout/stderr. That code was only making it
1134 to survive broken stdout/stderr. That code was only making it
1122 harder to abstract out the i/o (necessary for gui integration),
1135 harder to abstract out the i/o (necessary for gui integration),
1123 and the crashes it could prevent were extremely rare in practice
1136 and the crashes it could prevent were extremely rare in practice
1124 (besides being fully user-induced in a pretty violent manner).
1137 (besides being fully user-induced in a pretty violent manner).
1125
1138
1126 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1139 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1127 Nothing major yet, but the code is simpler to read; this should
1140 Nothing major yet, but the code is simpler to read; this should
1128 make it easier to do more serious modifications in the future.
1141 make it easier to do more serious modifications in the future.
1129
1142
1130 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1143 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1131 which broke in .15 (thanks to a report by Ville).
1144 which broke in .15 (thanks to a report by Ville).
1132
1145
1133 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1146 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1134 be quite correct, I know next to nothing about unicode). This
1147 be quite correct, I know next to nothing about unicode). This
1135 will allow unicode strings to be used in prompts, amongst other
1148 will allow unicode strings to be used in prompts, amongst other
1136 cases. It also will prevent ipython from crashing when unicode
1149 cases. It also will prevent ipython from crashing when unicode
1137 shows up unexpectedly in many places. If ascii encoding fails, we
1150 shows up unexpectedly in many places. If ascii encoding fails, we
1138 assume utf_8. Currently the encoding is not a user-visible
1151 assume utf_8. Currently the encoding is not a user-visible
1139 setting, though it could be made so if there is demand for it.
1152 setting, though it could be made so if there is demand for it.
1140
1153
1141 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1154 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1142
1155
1143 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1156 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1144
1157
1145 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1158 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1146
1159
1147 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1160 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1148 code can work transparently for 2.2/2.3.
1161 code can work transparently for 2.2/2.3.
1149
1162
1150 2005-07-16 Fernando Perez <fperez@colorado.edu>
1163 2005-07-16 Fernando Perez <fperez@colorado.edu>
1151
1164
1152 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1165 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1153 out of the color scheme table used for coloring exception
1166 out of the color scheme table used for coloring exception
1154 tracebacks. This allows user code to add new schemes at runtime.
1167 tracebacks. This allows user code to add new schemes at runtime.
1155 This is a minimally modified version of the patch at
1168 This is a minimally modified version of the patch at
1156 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1169 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1157 for the contribution.
1170 for the contribution.
1158
1171
1159 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1172 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1160 slightly modified version of the patch in
1173 slightly modified version of the patch in
1161 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1174 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1162 to remove the previous try/except solution (which was costlier).
1175 to remove the previous try/except solution (which was costlier).
1163 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1176 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1164
1177
1165 2005-06-08 Fernando Perez <fperez@colorado.edu>
1178 2005-06-08 Fernando Perez <fperez@colorado.edu>
1166
1179
1167 * IPython/iplib.py (write/write_err): Add methods to abstract all
1180 * IPython/iplib.py (write/write_err): Add methods to abstract all
1168 I/O a bit more.
1181 I/O a bit more.
1169
1182
1170 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1183 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1171 warning, reported by Aric Hagberg, fix by JD Hunter.
1184 warning, reported by Aric Hagberg, fix by JD Hunter.
1172
1185
1173 2005-06-02 *** Released version 0.6.15
1186 2005-06-02 *** Released version 0.6.15
1174
1187
1175 2005-06-01 Fernando Perez <fperez@colorado.edu>
1188 2005-06-01 Fernando Perez <fperez@colorado.edu>
1176
1189
1177 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1190 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1178 tab-completion of filenames within open-quoted strings. Note that
1191 tab-completion of filenames within open-quoted strings. Note that
1179 this requires that in ~/.ipython/ipythonrc, users change the
1192 this requires that in ~/.ipython/ipythonrc, users change the
1180 readline delimiters configuration to read:
1193 readline delimiters configuration to read:
1181
1194
1182 readline_remove_delims -/~
1195 readline_remove_delims -/~
1183
1196
1184
1197
1185 2005-05-31 *** Released version 0.6.14
1198 2005-05-31 *** Released version 0.6.14
1186
1199
1187 2005-05-29 Fernando Perez <fperez@colorado.edu>
1200 2005-05-29 Fernando Perez <fperez@colorado.edu>
1188
1201
1189 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1202 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1190 with files not on the filesystem. Reported by Eliyahu Sandler
1203 with files not on the filesystem. Reported by Eliyahu Sandler
1191 <eli@gondolin.net>
1204 <eli@gondolin.net>
1192
1205
1193 2005-05-22 Fernando Perez <fperez@colorado.edu>
1206 2005-05-22 Fernando Perez <fperez@colorado.edu>
1194
1207
1195 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1208 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1196 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1209 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1197
1210
1198 2005-05-19 Fernando Perez <fperez@colorado.edu>
1211 2005-05-19 Fernando Perez <fperez@colorado.edu>
1199
1212
1200 * IPython/iplib.py (safe_execfile): close a file which could be
1213 * IPython/iplib.py (safe_execfile): close a file which could be
1201 left open (causing problems in win32, which locks open files).
1214 left open (causing problems in win32, which locks open files).
1202 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1215 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1203
1216
1204 2005-05-18 Fernando Perez <fperez@colorado.edu>
1217 2005-05-18 Fernando Perez <fperez@colorado.edu>
1205
1218
1206 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1219 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1207 keyword arguments correctly to safe_execfile().
1220 keyword arguments correctly to safe_execfile().
1208
1221
1209 2005-05-13 Fernando Perez <fperez@colorado.edu>
1222 2005-05-13 Fernando Perez <fperez@colorado.edu>
1210
1223
1211 * ipython.1: Added info about Qt to manpage, and threads warning
1224 * ipython.1: Added info about Qt to manpage, and threads warning
1212 to usage page (invoked with --help).
1225 to usage page (invoked with --help).
1213
1226
1214 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1227 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1215 new matcher (it goes at the end of the priority list) to do
1228 new matcher (it goes at the end of the priority list) to do
1216 tab-completion on named function arguments. Submitted by George
1229 tab-completion on named function arguments. Submitted by George
1217 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1230 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1218 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1231 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1219 for more details.
1232 for more details.
1220
1233
1221 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1234 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1222 SystemExit exceptions in the script being run. Thanks to a report
1235 SystemExit exceptions in the script being run. Thanks to a report
1223 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1236 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1224 producing very annoying behavior when running unit tests.
1237 producing very annoying behavior when running unit tests.
1225
1238
1226 2005-05-12 Fernando Perez <fperez@colorado.edu>
1239 2005-05-12 Fernando Perez <fperez@colorado.edu>
1227
1240
1228 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1241 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1229 which I'd broken (again) due to a changed regexp. In the process,
1242 which I'd broken (again) due to a changed regexp. In the process,
1230 added ';' as an escape to auto-quote the whole line without
1243 added ';' as an escape to auto-quote the whole line without
1231 splitting its arguments. Thanks to a report by Jerry McRae
1244 splitting its arguments. Thanks to a report by Jerry McRae
1232 <qrs0xyc02-AT-sneakemail.com>.
1245 <qrs0xyc02-AT-sneakemail.com>.
1233
1246
1234 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1247 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1235 possible crashes caused by a TokenError. Reported by Ed Schofield
1248 possible crashes caused by a TokenError. Reported by Ed Schofield
1236 <schofield-AT-ftw.at>.
1249 <schofield-AT-ftw.at>.
1237
1250
1238 2005-05-06 Fernando Perez <fperez@colorado.edu>
1251 2005-05-06 Fernando Perez <fperez@colorado.edu>
1239
1252
1240 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1253 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1241
1254
1242 2005-04-29 Fernando Perez <fperez@colorado.edu>
1255 2005-04-29 Fernando Perez <fperez@colorado.edu>
1243
1256
1244 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1257 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1245 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1258 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1246 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1259 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1247 which provides support for Qt interactive usage (similar to the
1260 which provides support for Qt interactive usage (similar to the
1248 existing one for WX and GTK). This had been often requested.
1261 existing one for WX and GTK). This had been often requested.
1249
1262
1250 2005-04-14 *** Released version 0.6.13
1263 2005-04-14 *** Released version 0.6.13
1251
1264
1252 2005-04-08 Fernando Perez <fperez@colorado.edu>
1265 2005-04-08 Fernando Perez <fperez@colorado.edu>
1253
1266
1254 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1267 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1255 from _ofind, which gets called on almost every input line. Now,
1268 from _ofind, which gets called on almost every input line. Now,
1256 we only try to get docstrings if they are actually going to be
1269 we only try to get docstrings if they are actually going to be
1257 used (the overhead of fetching unnecessary docstrings can be
1270 used (the overhead of fetching unnecessary docstrings can be
1258 noticeable for certain objects, such as Pyro proxies).
1271 noticeable for certain objects, such as Pyro proxies).
1259
1272
1260 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1273 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1261 for completers. For some reason I had been passing them the state
1274 for completers. For some reason I had been passing them the state
1262 variable, which completers never actually need, and was in
1275 variable, which completers never actually need, and was in
1263 conflict with the rlcompleter API. Custom completers ONLY need to
1276 conflict with the rlcompleter API. Custom completers ONLY need to
1264 take the text parameter.
1277 take the text parameter.
1265
1278
1266 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1279 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1267 work correctly in pysh. I've also moved all the logic which used
1280 work correctly in pysh. I've also moved all the logic which used
1268 to be in pysh.py here, which will prevent problems with future
1281 to be in pysh.py here, which will prevent problems with future
1269 upgrades. However, this time I must warn users to update their
1282 upgrades. However, this time I must warn users to update their
1270 pysh profile to include the line
1283 pysh profile to include the line
1271
1284
1272 import_all IPython.Extensions.InterpreterExec
1285 import_all IPython.Extensions.InterpreterExec
1273
1286
1274 because otherwise things won't work for them. They MUST also
1287 because otherwise things won't work for them. They MUST also
1275 delete pysh.py and the line
1288 delete pysh.py and the line
1276
1289
1277 execfile pysh.py
1290 execfile pysh.py
1278
1291
1279 from their ipythonrc-pysh.
1292 from their ipythonrc-pysh.
1280
1293
1281 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1294 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1282 robust in the face of objects whose dir() returns non-strings
1295 robust in the face of objects whose dir() returns non-strings
1283 (which it shouldn't, but some broken libs like ITK do). Thanks to
1296 (which it shouldn't, but some broken libs like ITK do). Thanks to
1284 a patch by John Hunter (implemented differently, though). Also
1297 a patch by John Hunter (implemented differently, though). Also
1285 minor improvements by using .extend instead of + on lists.
1298 minor improvements by using .extend instead of + on lists.
1286
1299
1287 * pysh.py:
1300 * pysh.py:
1288
1301
1289 2005-04-06 Fernando Perez <fperez@colorado.edu>
1302 2005-04-06 Fernando Perez <fperez@colorado.edu>
1290
1303
1291 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1304 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1292 by default, so that all users benefit from it. Those who don't
1305 by default, so that all users benefit from it. Those who don't
1293 want it can still turn it off.
1306 want it can still turn it off.
1294
1307
1295 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1308 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1296 config file, I'd forgotten about this, so users were getting it
1309 config file, I'd forgotten about this, so users were getting it
1297 off by default.
1310 off by default.
1298
1311
1299 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1312 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1300 consistency. Now magics can be called in multiline statements,
1313 consistency. Now magics can be called in multiline statements,
1301 and python variables can be expanded in magic calls via $var.
1314 and python variables can be expanded in magic calls via $var.
1302 This makes the magic system behave just like aliases or !system
1315 This makes the magic system behave just like aliases or !system
1303 calls.
1316 calls.
1304
1317
1305 2005-03-28 Fernando Perez <fperez@colorado.edu>
1318 2005-03-28 Fernando Perez <fperez@colorado.edu>
1306
1319
1307 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1320 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1308 expensive string additions for building command. Add support for
1321 expensive string additions for building command. Add support for
1309 trailing ';' when autocall is used.
1322 trailing ';' when autocall is used.
1310
1323
1311 2005-03-26 Fernando Perez <fperez@colorado.edu>
1324 2005-03-26 Fernando Perez <fperez@colorado.edu>
1312
1325
1313 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1326 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1314 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1327 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1315 ipython.el robust against prompts with any number of spaces
1328 ipython.el robust against prompts with any number of spaces
1316 (including 0) after the ':' character.
1329 (including 0) after the ':' character.
1317
1330
1318 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1331 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1319 continuation prompt, which misled users to think the line was
1332 continuation prompt, which misled users to think the line was
1320 already indented. Closes debian Bug#300847, reported to me by
1333 already indented. Closes debian Bug#300847, reported to me by
1321 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1334 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1322
1335
1323 2005-03-23 Fernando Perez <fperez@colorado.edu>
1336 2005-03-23 Fernando Perez <fperez@colorado.edu>
1324
1337
1325 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1338 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1326 properly aligned if they have embedded newlines.
1339 properly aligned if they have embedded newlines.
1327
1340
1328 * IPython/iplib.py (runlines): Add a public method to expose
1341 * IPython/iplib.py (runlines): Add a public method to expose
1329 IPython's code execution machinery, so that users can run strings
1342 IPython's code execution machinery, so that users can run strings
1330 as if they had been typed at the prompt interactively.
1343 as if they had been typed at the prompt interactively.
1331 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1344 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1332 methods which can call the system shell, but with python variable
1345 methods which can call the system shell, but with python variable
1333 expansion. The three such methods are: __IPYTHON__.system,
1346 expansion. The three such methods are: __IPYTHON__.system,
1334 .getoutput and .getoutputerror. These need to be documented in a
1347 .getoutput and .getoutputerror. These need to be documented in a
1335 'public API' section (to be written) of the manual.
1348 'public API' section (to be written) of the manual.
1336
1349
1337 2005-03-20 Fernando Perez <fperez@colorado.edu>
1350 2005-03-20 Fernando Perez <fperez@colorado.edu>
1338
1351
1339 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1352 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1340 for custom exception handling. This is quite powerful, and it
1353 for custom exception handling. This is quite powerful, and it
1341 allows for user-installable exception handlers which can trap
1354 allows for user-installable exception handlers which can trap
1342 custom exceptions at runtime and treat them separately from
1355 custom exceptions at runtime and treat them separately from
1343 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1356 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1344 Mantegazza <mantegazza-AT-ill.fr>.
1357 Mantegazza <mantegazza-AT-ill.fr>.
1345 (InteractiveShell.set_custom_completer): public API function to
1358 (InteractiveShell.set_custom_completer): public API function to
1346 add new completers at runtime.
1359 add new completers at runtime.
1347
1360
1348 2005-03-19 Fernando Perez <fperez@colorado.edu>
1361 2005-03-19 Fernando Perez <fperez@colorado.edu>
1349
1362
1350 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1363 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1351 allow objects which provide their docstrings via non-standard
1364 allow objects which provide their docstrings via non-standard
1352 mechanisms (like Pyro proxies) to still be inspected by ipython's
1365 mechanisms (like Pyro proxies) to still be inspected by ipython's
1353 ? system.
1366 ? system.
1354
1367
1355 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1368 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1356 automatic capture system. I tried quite hard to make it work
1369 automatic capture system. I tried quite hard to make it work
1357 reliably, and simply failed. I tried many combinations with the
1370 reliably, and simply failed. I tried many combinations with the
1358 subprocess module, but eventually nothing worked in all needed
1371 subprocess module, but eventually nothing worked in all needed
1359 cases (not blocking stdin for the child, duplicating stdout
1372 cases (not blocking stdin for the child, duplicating stdout
1360 without blocking, etc). The new %sc/%sx still do capture to these
1373 without blocking, etc). The new %sc/%sx still do capture to these
1361 magical list/string objects which make shell use much more
1374 magical list/string objects which make shell use much more
1362 conveninent, so not all is lost.
1375 conveninent, so not all is lost.
1363
1376
1364 XXX - FIX MANUAL for the change above!
1377 XXX - FIX MANUAL for the change above!
1365
1378
1366 (runsource): I copied code.py's runsource() into ipython to modify
1379 (runsource): I copied code.py's runsource() into ipython to modify
1367 it a bit. Now the code object and source to be executed are
1380 it a bit. Now the code object and source to be executed are
1368 stored in ipython. This makes this info accessible to third-party
1381 stored in ipython. This makes this info accessible to third-party
1369 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1382 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1370 Mantegazza <mantegazza-AT-ill.fr>.
1383 Mantegazza <mantegazza-AT-ill.fr>.
1371
1384
1372 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1385 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1373 history-search via readline (like C-p/C-n). I'd wanted this for a
1386 history-search via readline (like C-p/C-n). I'd wanted this for a
1374 long time, but only recently found out how to do it. For users
1387 long time, but only recently found out how to do it. For users
1375 who already have their ipythonrc files made and want this, just
1388 who already have their ipythonrc files made and want this, just
1376 add:
1389 add:
1377
1390
1378 readline_parse_and_bind "\e[A": history-search-backward
1391 readline_parse_and_bind "\e[A": history-search-backward
1379 readline_parse_and_bind "\e[B": history-search-forward
1392 readline_parse_and_bind "\e[B": history-search-forward
1380
1393
1381 2005-03-18 Fernando Perez <fperez@colorado.edu>
1394 2005-03-18 Fernando Perez <fperez@colorado.edu>
1382
1395
1383 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1396 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1384 LSString and SList classes which allow transparent conversions
1397 LSString and SList classes which allow transparent conversions
1385 between list mode and whitespace-separated string.
1398 between list mode and whitespace-separated string.
1386 (magic_r): Fix recursion problem in %r.
1399 (magic_r): Fix recursion problem in %r.
1387
1400
1388 * IPython/genutils.py (LSString): New class to be used for
1401 * IPython/genutils.py (LSString): New class to be used for
1389 automatic storage of the results of all alias/system calls in _o
1402 automatic storage of the results of all alias/system calls in _o
1390 and _e (stdout/err). These provide a .l/.list attribute which
1403 and _e (stdout/err). These provide a .l/.list attribute which
1391 does automatic splitting on newlines. This means that for most
1404 does automatic splitting on newlines. This means that for most
1392 uses, you'll never need to do capturing of output with %sc/%sx
1405 uses, you'll never need to do capturing of output with %sc/%sx
1393 anymore, since ipython keeps this always done for you. Note that
1406 anymore, since ipython keeps this always done for you. Note that
1394 only the LAST results are stored, the _o/e variables are
1407 only the LAST results are stored, the _o/e variables are
1395 overwritten on each call. If you need to save their contents
1408 overwritten on each call. If you need to save their contents
1396 further, simply bind them to any other name.
1409 further, simply bind them to any other name.
1397
1410
1398 2005-03-17 Fernando Perez <fperez@colorado.edu>
1411 2005-03-17 Fernando Perez <fperez@colorado.edu>
1399
1412
1400 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1413 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1401 prompt namespace handling.
1414 prompt namespace handling.
1402
1415
1403 2005-03-16 Fernando Perez <fperez@colorado.edu>
1416 2005-03-16 Fernando Perez <fperez@colorado.edu>
1404
1417
1405 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1418 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1406 classic prompts to be '>>> ' (final space was missing, and it
1419 classic prompts to be '>>> ' (final space was missing, and it
1407 trips the emacs python mode).
1420 trips the emacs python mode).
1408 (BasePrompt.__str__): Added safe support for dynamic prompt
1421 (BasePrompt.__str__): Added safe support for dynamic prompt
1409 strings. Now you can set your prompt string to be '$x', and the
1422 strings. Now you can set your prompt string to be '$x', and the
1410 value of x will be printed from your interactive namespace. The
1423 value of x will be printed from your interactive namespace. The
1411 interpolation syntax includes the full Itpl support, so
1424 interpolation syntax includes the full Itpl support, so
1412 ${foo()+x+bar()} is a valid prompt string now, and the function
1425 ${foo()+x+bar()} is a valid prompt string now, and the function
1413 calls will be made at runtime.
1426 calls will be made at runtime.
1414
1427
1415 2005-03-15 Fernando Perez <fperez@colorado.edu>
1428 2005-03-15 Fernando Perez <fperez@colorado.edu>
1416
1429
1417 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1430 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1418 avoid name clashes in pylab. %hist still works, it just forwards
1431 avoid name clashes in pylab. %hist still works, it just forwards
1419 the call to %history.
1432 the call to %history.
1420
1433
1421 2005-03-02 *** Released version 0.6.12
1434 2005-03-02 *** Released version 0.6.12
1422
1435
1423 2005-03-02 Fernando Perez <fperez@colorado.edu>
1436 2005-03-02 Fernando Perez <fperez@colorado.edu>
1424
1437
1425 * IPython/iplib.py (handle_magic): log magic calls properly as
1438 * IPython/iplib.py (handle_magic): log magic calls properly as
1426 ipmagic() function calls.
1439 ipmagic() function calls.
1427
1440
1428 * IPython/Magic.py (magic_time): Improved %time to support
1441 * IPython/Magic.py (magic_time): Improved %time to support
1429 statements and provide wall-clock as well as CPU time.
1442 statements and provide wall-clock as well as CPU time.
1430
1443
1431 2005-02-27 Fernando Perez <fperez@colorado.edu>
1444 2005-02-27 Fernando Perez <fperez@colorado.edu>
1432
1445
1433 * IPython/hooks.py: New hooks module, to expose user-modifiable
1446 * IPython/hooks.py: New hooks module, to expose user-modifiable
1434 IPython functionality in a clean manner. For now only the editor
1447 IPython functionality in a clean manner. For now only the editor
1435 hook is actually written, and other thigns which I intend to turn
1448 hook is actually written, and other thigns which I intend to turn
1436 into proper hooks aren't yet there. The display and prefilter
1449 into proper hooks aren't yet there. The display and prefilter
1437 stuff, for example, should be hooks. But at least now the
1450 stuff, for example, should be hooks. But at least now the
1438 framework is in place, and the rest can be moved here with more
1451 framework is in place, and the rest can be moved here with more
1439 time later. IPython had had a .hooks variable for a long time for
1452 time later. IPython had had a .hooks variable for a long time for
1440 this purpose, but I'd never actually used it for anything.
1453 this purpose, but I'd never actually used it for anything.
1441
1454
1442 2005-02-26 Fernando Perez <fperez@colorado.edu>
1455 2005-02-26 Fernando Perez <fperez@colorado.edu>
1443
1456
1444 * IPython/ipmaker.py (make_IPython): make the default ipython
1457 * IPython/ipmaker.py (make_IPython): make the default ipython
1445 directory be called _ipython under win32, to follow more the
1458 directory be called _ipython under win32, to follow more the
1446 naming peculiarities of that platform (where buggy software like
1459 naming peculiarities of that platform (where buggy software like
1447 Visual Sourcesafe breaks with .named directories). Reported by
1460 Visual Sourcesafe breaks with .named directories). Reported by
1448 Ville Vainio.
1461 Ville Vainio.
1449
1462
1450 2005-02-23 Fernando Perez <fperez@colorado.edu>
1463 2005-02-23 Fernando Perez <fperez@colorado.edu>
1451
1464
1452 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1465 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1453 auto_aliases for win32 which were causing problems. Users can
1466 auto_aliases for win32 which were causing problems. Users can
1454 define the ones they personally like.
1467 define the ones they personally like.
1455
1468
1456 2005-02-21 Fernando Perez <fperez@colorado.edu>
1469 2005-02-21 Fernando Perez <fperez@colorado.edu>
1457
1470
1458 * IPython/Magic.py (magic_time): new magic to time execution of
1471 * IPython/Magic.py (magic_time): new magic to time execution of
1459 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1472 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1460
1473
1461 2005-02-19 Fernando Perez <fperez@colorado.edu>
1474 2005-02-19 Fernando Perez <fperez@colorado.edu>
1462
1475
1463 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1476 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1464 into keys (for prompts, for example).
1477 into keys (for prompts, for example).
1465
1478
1466 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1479 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1467 prompts in case users want them. This introduces a small behavior
1480 prompts in case users want them. This introduces a small behavior
1468 change: ipython does not automatically add a space to all prompts
1481 change: ipython does not automatically add a space to all prompts
1469 anymore. To get the old prompts with a space, users should add it
1482 anymore. To get the old prompts with a space, users should add it
1470 manually to their ipythonrc file, so for example prompt_in1 should
1483 manually to their ipythonrc file, so for example prompt_in1 should
1471 now read 'In [\#]: ' instead of 'In [\#]:'.
1484 now read 'In [\#]: ' instead of 'In [\#]:'.
1472 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1485 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1473 file) to control left-padding of secondary prompts.
1486 file) to control left-padding of secondary prompts.
1474
1487
1475 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1488 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1476 the profiler can't be imported. Fix for Debian, which removed
1489 the profiler can't be imported. Fix for Debian, which removed
1477 profile.py because of License issues. I applied a slightly
1490 profile.py because of License issues. I applied a slightly
1478 modified version of the original Debian patch at
1491 modified version of the original Debian patch at
1479 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1492 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1480
1493
1481 2005-02-17 Fernando Perez <fperez@colorado.edu>
1494 2005-02-17 Fernando Perez <fperez@colorado.edu>
1482
1495
1483 * IPython/genutils.py (native_line_ends): Fix bug which would
1496 * IPython/genutils.py (native_line_ends): Fix bug which would
1484 cause improper line-ends under win32 b/c I was not opening files
1497 cause improper line-ends under win32 b/c I was not opening files
1485 in binary mode. Bug report and fix thanks to Ville.
1498 in binary mode. Bug report and fix thanks to Ville.
1486
1499
1487 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1500 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1488 trying to catch spurious foo[1] autocalls. My fix actually broke
1501 trying to catch spurious foo[1] autocalls. My fix actually broke
1489 ',/' autoquote/call with explicit escape (bad regexp).
1502 ',/' autoquote/call with explicit escape (bad regexp).
1490
1503
1491 2005-02-15 *** Released version 0.6.11
1504 2005-02-15 *** Released version 0.6.11
1492
1505
1493 2005-02-14 Fernando Perez <fperez@colorado.edu>
1506 2005-02-14 Fernando Perez <fperez@colorado.edu>
1494
1507
1495 * IPython/background_jobs.py: New background job management
1508 * IPython/background_jobs.py: New background job management
1496 subsystem. This is implemented via a new set of classes, and
1509 subsystem. This is implemented via a new set of classes, and
1497 IPython now provides a builtin 'jobs' object for background job
1510 IPython now provides a builtin 'jobs' object for background job
1498 execution. A convenience %bg magic serves as a lightweight
1511 execution. A convenience %bg magic serves as a lightweight
1499 frontend for starting the more common type of calls. This was
1512 frontend for starting the more common type of calls. This was
1500 inspired by discussions with B. Granger and the BackgroundCommand
1513 inspired by discussions with B. Granger and the BackgroundCommand
1501 class described in the book Python Scripting for Computational
1514 class described in the book Python Scripting for Computational
1502 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1515 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1503 (although ultimately no code from this text was used, as IPython's
1516 (although ultimately no code from this text was used, as IPython's
1504 system is a separate implementation).
1517 system is a separate implementation).
1505
1518
1506 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1519 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1507 to control the completion of single/double underscore names
1520 to control the completion of single/double underscore names
1508 separately. As documented in the example ipytonrc file, the
1521 separately. As documented in the example ipytonrc file, the
1509 readline_omit__names variable can now be set to 2, to omit even
1522 readline_omit__names variable can now be set to 2, to omit even
1510 single underscore names. Thanks to a patch by Brian Wong
1523 single underscore names. Thanks to a patch by Brian Wong
1511 <BrianWong-AT-AirgoNetworks.Com>.
1524 <BrianWong-AT-AirgoNetworks.Com>.
1512 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1525 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1513 be autocalled as foo([1]) if foo were callable. A problem for
1526 be autocalled as foo([1]) if foo were callable. A problem for
1514 things which are both callable and implement __getitem__.
1527 things which are both callable and implement __getitem__.
1515 (init_readline): Fix autoindentation for win32. Thanks to a patch
1528 (init_readline): Fix autoindentation for win32. Thanks to a patch
1516 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1529 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1517
1530
1518 2005-02-12 Fernando Perez <fperez@colorado.edu>
1531 2005-02-12 Fernando Perez <fperez@colorado.edu>
1519
1532
1520 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1533 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1521 which I had written long ago to sort out user error messages which
1534 which I had written long ago to sort out user error messages which
1522 may occur during startup. This seemed like a good idea initially,
1535 may occur during startup. This seemed like a good idea initially,
1523 but it has proven a disaster in retrospect. I don't want to
1536 but it has proven a disaster in retrospect. I don't want to
1524 change much code for now, so my fix is to set the internal 'debug'
1537 change much code for now, so my fix is to set the internal 'debug'
1525 flag to true everywhere, whose only job was precisely to control
1538 flag to true everywhere, whose only job was precisely to control
1526 this subsystem. This closes issue 28 (as well as avoiding all
1539 this subsystem. This closes issue 28 (as well as avoiding all
1527 sorts of strange hangups which occur from time to time).
1540 sorts of strange hangups which occur from time to time).
1528
1541
1529 2005-02-07 Fernando Perez <fperez@colorado.edu>
1542 2005-02-07 Fernando Perez <fperez@colorado.edu>
1530
1543
1531 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1544 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1532 previous call produced a syntax error.
1545 previous call produced a syntax error.
1533
1546
1534 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1547 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1535 classes without constructor.
1548 classes without constructor.
1536
1549
1537 2005-02-06 Fernando Perez <fperez@colorado.edu>
1550 2005-02-06 Fernando Perez <fperez@colorado.edu>
1538
1551
1539 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1552 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1540 completions with the results of each matcher, so we return results
1553 completions with the results of each matcher, so we return results
1541 to the user from all namespaces. This breaks with ipython
1554 to the user from all namespaces. This breaks with ipython
1542 tradition, but I think it's a nicer behavior. Now you get all
1555 tradition, but I think it's a nicer behavior. Now you get all
1543 possible completions listed, from all possible namespaces (python,
1556 possible completions listed, from all possible namespaces (python,
1544 filesystem, magics...) After a request by John Hunter
1557 filesystem, magics...) After a request by John Hunter
1545 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1558 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1546
1559
1547 2005-02-05 Fernando Perez <fperez@colorado.edu>
1560 2005-02-05 Fernando Perez <fperez@colorado.edu>
1548
1561
1549 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1562 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1550 the call had quote characters in it (the quotes were stripped).
1563 the call had quote characters in it (the quotes were stripped).
1551
1564
1552 2005-01-31 Fernando Perez <fperez@colorado.edu>
1565 2005-01-31 Fernando Perez <fperez@colorado.edu>
1553
1566
1554 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1567 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1555 Itpl.itpl() to make the code more robust against psyco
1568 Itpl.itpl() to make the code more robust against psyco
1556 optimizations.
1569 optimizations.
1557
1570
1558 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1571 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1559 of causing an exception. Quicker, cleaner.
1572 of causing an exception. Quicker, cleaner.
1560
1573
1561 2005-01-28 Fernando Perez <fperez@colorado.edu>
1574 2005-01-28 Fernando Perez <fperez@colorado.edu>
1562
1575
1563 * scripts/ipython_win_post_install.py (install): hardcode
1576 * scripts/ipython_win_post_install.py (install): hardcode
1564 sys.prefix+'python.exe' as the executable path. It turns out that
1577 sys.prefix+'python.exe' as the executable path. It turns out that
1565 during the post-installation run, sys.executable resolves to the
1578 during the post-installation run, sys.executable resolves to the
1566 name of the binary installer! I should report this as a distutils
1579 name of the binary installer! I should report this as a distutils
1567 bug, I think. I updated the .10 release with this tiny fix, to
1580 bug, I think. I updated the .10 release with this tiny fix, to
1568 avoid annoying the lists further.
1581 avoid annoying the lists further.
1569
1582
1570 2005-01-27 *** Released version 0.6.10
1583 2005-01-27 *** Released version 0.6.10
1571
1584
1572 2005-01-27 Fernando Perez <fperez@colorado.edu>
1585 2005-01-27 Fernando Perez <fperez@colorado.edu>
1573
1586
1574 * IPython/numutils.py (norm): Added 'inf' as optional name for
1587 * IPython/numutils.py (norm): Added 'inf' as optional name for
1575 L-infinity norm, included references to mathworld.com for vector
1588 L-infinity norm, included references to mathworld.com for vector
1576 norm definitions.
1589 norm definitions.
1577 (amin/amax): added amin/amax for array min/max. Similar to what
1590 (amin/amax): added amin/amax for array min/max. Similar to what
1578 pylab ships with after the recent reorganization of names.
1591 pylab ships with after the recent reorganization of names.
1579 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1592 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1580
1593
1581 * ipython.el: committed Alex's recent fixes and improvements.
1594 * ipython.el: committed Alex's recent fixes and improvements.
1582 Tested with python-mode from CVS, and it looks excellent. Since
1595 Tested with python-mode from CVS, and it looks excellent. Since
1583 python-mode hasn't released anything in a while, I'm temporarily
1596 python-mode hasn't released anything in a while, I'm temporarily
1584 putting a copy of today's CVS (v 4.70) of python-mode in:
1597 putting a copy of today's CVS (v 4.70) of python-mode in:
1585 http://ipython.scipy.org/tmp/python-mode.el
1598 http://ipython.scipy.org/tmp/python-mode.el
1586
1599
1587 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1600 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1588 sys.executable for the executable name, instead of assuming it's
1601 sys.executable for the executable name, instead of assuming it's
1589 called 'python.exe' (the post-installer would have produced broken
1602 called 'python.exe' (the post-installer would have produced broken
1590 setups on systems with a differently named python binary).
1603 setups on systems with a differently named python binary).
1591
1604
1592 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1605 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1593 references to os.linesep, to make the code more
1606 references to os.linesep, to make the code more
1594 platform-independent. This is also part of the win32 coloring
1607 platform-independent. This is also part of the win32 coloring
1595 fixes.
1608 fixes.
1596
1609
1597 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1610 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1598 lines, which actually cause coloring bugs because the length of
1611 lines, which actually cause coloring bugs because the length of
1599 the line is very difficult to correctly compute with embedded
1612 the line is very difficult to correctly compute with embedded
1600 escapes. This was the source of all the coloring problems under
1613 escapes. This was the source of all the coloring problems under
1601 Win32. I think that _finally_, Win32 users have a properly
1614 Win32. I think that _finally_, Win32 users have a properly
1602 working ipython in all respects. This would never have happened
1615 working ipython in all respects. This would never have happened
1603 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1616 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1604
1617
1605 2005-01-26 *** Released version 0.6.9
1618 2005-01-26 *** Released version 0.6.9
1606
1619
1607 2005-01-25 Fernando Perez <fperez@colorado.edu>
1620 2005-01-25 Fernando Perez <fperez@colorado.edu>
1608
1621
1609 * setup.py: finally, we have a true Windows installer, thanks to
1622 * setup.py: finally, we have a true Windows installer, thanks to
1610 the excellent work of Viktor Ransmayr
1623 the excellent work of Viktor Ransmayr
1611 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1624 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1612 Windows users. The setup routine is quite a bit cleaner thanks to
1625 Windows users. The setup routine is quite a bit cleaner thanks to
1613 this, and the post-install script uses the proper functions to
1626 this, and the post-install script uses the proper functions to
1614 allow a clean de-installation using the standard Windows Control
1627 allow a clean de-installation using the standard Windows Control
1615 Panel.
1628 Panel.
1616
1629
1617 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1630 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1618 environment variable under all OSes (including win32) if
1631 environment variable under all OSes (including win32) if
1619 available. This will give consistency to win32 users who have set
1632 available. This will give consistency to win32 users who have set
1620 this variable for any reason. If os.environ['HOME'] fails, the
1633 this variable for any reason. If os.environ['HOME'] fails, the
1621 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1634 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1622
1635
1623 2005-01-24 Fernando Perez <fperez@colorado.edu>
1636 2005-01-24 Fernando Perez <fperez@colorado.edu>
1624
1637
1625 * IPython/numutils.py (empty_like): add empty_like(), similar to
1638 * IPython/numutils.py (empty_like): add empty_like(), similar to
1626 zeros_like() but taking advantage of the new empty() Numeric routine.
1639 zeros_like() but taking advantage of the new empty() Numeric routine.
1627
1640
1628 2005-01-23 *** Released version 0.6.8
1641 2005-01-23 *** Released version 0.6.8
1629
1642
1630 2005-01-22 Fernando Perez <fperez@colorado.edu>
1643 2005-01-22 Fernando Perez <fperez@colorado.edu>
1631
1644
1632 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1645 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1633 automatic show() calls. After discussing things with JDH, it
1646 automatic show() calls. After discussing things with JDH, it
1634 turns out there are too many corner cases where this can go wrong.
1647 turns out there are too many corner cases where this can go wrong.
1635 It's best not to try to be 'too smart', and simply have ipython
1648 It's best not to try to be 'too smart', and simply have ipython
1636 reproduce as much as possible the default behavior of a normal
1649 reproduce as much as possible the default behavior of a normal
1637 python shell.
1650 python shell.
1638
1651
1639 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1652 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1640 line-splitting regexp and _prefilter() to avoid calling getattr()
1653 line-splitting regexp and _prefilter() to avoid calling getattr()
1641 on assignments. This closes
1654 on assignments. This closes
1642 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1655 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1643 readline uses getattr(), so a simple <TAB> keypress is still
1656 readline uses getattr(), so a simple <TAB> keypress is still
1644 enough to trigger getattr() calls on an object.
1657 enough to trigger getattr() calls on an object.
1645
1658
1646 2005-01-21 Fernando Perez <fperez@colorado.edu>
1659 2005-01-21 Fernando Perez <fperez@colorado.edu>
1647
1660
1648 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1661 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1649 docstring under pylab so it doesn't mask the original.
1662 docstring under pylab so it doesn't mask the original.
1650
1663
1651 2005-01-21 *** Released version 0.6.7
1664 2005-01-21 *** Released version 0.6.7
1652
1665
1653 2005-01-21 Fernando Perez <fperez@colorado.edu>
1666 2005-01-21 Fernando Perez <fperez@colorado.edu>
1654
1667
1655 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1668 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1656 signal handling for win32 users in multithreaded mode.
1669 signal handling for win32 users in multithreaded mode.
1657
1670
1658 2005-01-17 Fernando Perez <fperez@colorado.edu>
1671 2005-01-17 Fernando Perez <fperez@colorado.edu>
1659
1672
1660 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1673 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1661 instances with no __init__. After a crash report by Norbert Nemec
1674 instances with no __init__. After a crash report by Norbert Nemec
1662 <Norbert-AT-nemec-online.de>.
1675 <Norbert-AT-nemec-online.de>.
1663
1676
1664 2005-01-14 Fernando Perez <fperez@colorado.edu>
1677 2005-01-14 Fernando Perez <fperez@colorado.edu>
1665
1678
1666 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1679 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1667 names for verbose exceptions, when multiple dotted names and the
1680 names for verbose exceptions, when multiple dotted names and the
1668 'parent' object were present on the same line.
1681 'parent' object were present on the same line.
1669
1682
1670 2005-01-11 Fernando Perez <fperez@colorado.edu>
1683 2005-01-11 Fernando Perez <fperez@colorado.edu>
1671
1684
1672 * IPython/genutils.py (flag_calls): new utility to trap and flag
1685 * IPython/genutils.py (flag_calls): new utility to trap and flag
1673 calls in functions. I need it to clean up matplotlib support.
1686 calls in functions. I need it to clean up matplotlib support.
1674 Also removed some deprecated code in genutils.
1687 Also removed some deprecated code in genutils.
1675
1688
1676 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1689 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1677 that matplotlib scripts called with %run, which don't call show()
1690 that matplotlib scripts called with %run, which don't call show()
1678 themselves, still have their plotting windows open.
1691 themselves, still have their plotting windows open.
1679
1692
1680 2005-01-05 Fernando Perez <fperez@colorado.edu>
1693 2005-01-05 Fernando Perez <fperez@colorado.edu>
1681
1694
1682 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1695 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1683 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1696 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1684
1697
1685 2004-12-19 Fernando Perez <fperez@colorado.edu>
1698 2004-12-19 Fernando Perez <fperez@colorado.edu>
1686
1699
1687 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1700 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1688 parent_runcode, which was an eyesore. The same result can be
1701 parent_runcode, which was an eyesore. The same result can be
1689 obtained with Python's regular superclass mechanisms.
1702 obtained with Python's regular superclass mechanisms.
1690
1703
1691 2004-12-17 Fernando Perez <fperez@colorado.edu>
1704 2004-12-17 Fernando Perez <fperez@colorado.edu>
1692
1705
1693 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1706 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1694 reported by Prabhu.
1707 reported by Prabhu.
1695 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1708 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1696 sys.stderr) instead of explicitly calling sys.stderr. This helps
1709 sys.stderr) instead of explicitly calling sys.stderr. This helps
1697 maintain our I/O abstractions clean, for future GUI embeddings.
1710 maintain our I/O abstractions clean, for future GUI embeddings.
1698
1711
1699 * IPython/genutils.py (info): added new utility for sys.stderr
1712 * IPython/genutils.py (info): added new utility for sys.stderr
1700 unified info message handling (thin wrapper around warn()).
1713 unified info message handling (thin wrapper around warn()).
1701
1714
1702 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1715 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1703 composite (dotted) names on verbose exceptions.
1716 composite (dotted) names on verbose exceptions.
1704 (VerboseTB.nullrepr): harden against another kind of errors which
1717 (VerboseTB.nullrepr): harden against another kind of errors which
1705 Python's inspect module can trigger, and which were crashing
1718 Python's inspect module can trigger, and which were crashing
1706 IPython. Thanks to a report by Marco Lombardi
1719 IPython. Thanks to a report by Marco Lombardi
1707 <mlombard-AT-ma010192.hq.eso.org>.
1720 <mlombard-AT-ma010192.hq.eso.org>.
1708
1721
1709 2004-12-13 *** Released version 0.6.6
1722 2004-12-13 *** Released version 0.6.6
1710
1723
1711 2004-12-12 Fernando Perez <fperez@colorado.edu>
1724 2004-12-12 Fernando Perez <fperez@colorado.edu>
1712
1725
1713 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1726 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1714 generated by pygtk upon initialization if it was built without
1727 generated by pygtk upon initialization if it was built without
1715 threads (for matplotlib users). After a crash reported by
1728 threads (for matplotlib users). After a crash reported by
1716 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1729 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1717
1730
1718 * IPython/ipmaker.py (make_IPython): fix small bug in the
1731 * IPython/ipmaker.py (make_IPython): fix small bug in the
1719 import_some parameter for multiple imports.
1732 import_some parameter for multiple imports.
1720
1733
1721 * IPython/iplib.py (ipmagic): simplified the interface of
1734 * IPython/iplib.py (ipmagic): simplified the interface of
1722 ipmagic() to take a single string argument, just as it would be
1735 ipmagic() to take a single string argument, just as it would be
1723 typed at the IPython cmd line.
1736 typed at the IPython cmd line.
1724 (ipalias): Added new ipalias() with an interface identical to
1737 (ipalias): Added new ipalias() with an interface identical to
1725 ipmagic(). This completes exposing a pure python interface to the
1738 ipmagic(). This completes exposing a pure python interface to the
1726 alias and magic system, which can be used in loops or more complex
1739 alias and magic system, which can be used in loops or more complex
1727 code where IPython's automatic line mangling is not active.
1740 code where IPython's automatic line mangling is not active.
1728
1741
1729 * IPython/genutils.py (timing): changed interface of timing to
1742 * IPython/genutils.py (timing): changed interface of timing to
1730 simply run code once, which is the most common case. timings()
1743 simply run code once, which is the most common case. timings()
1731 remains unchanged, for the cases where you want multiple runs.
1744 remains unchanged, for the cases where you want multiple runs.
1732
1745
1733 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1746 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1734 bug where Python2.2 crashes with exec'ing code which does not end
1747 bug where Python2.2 crashes with exec'ing code which does not end
1735 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1748 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1736 before.
1749 before.
1737
1750
1738 2004-12-10 Fernando Perez <fperez@colorado.edu>
1751 2004-12-10 Fernando Perez <fperez@colorado.edu>
1739
1752
1740 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1753 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1741 -t to -T, to accomodate the new -t flag in %run (the %run and
1754 -t to -T, to accomodate the new -t flag in %run (the %run and
1742 %prun options are kind of intermixed, and it's not easy to change
1755 %prun options are kind of intermixed, and it's not easy to change
1743 this with the limitations of python's getopt).
1756 this with the limitations of python's getopt).
1744
1757
1745 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1758 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1746 the execution of scripts. It's not as fine-tuned as timeit.py,
1759 the execution of scripts. It's not as fine-tuned as timeit.py,
1747 but it works from inside ipython (and under 2.2, which lacks
1760 but it works from inside ipython (and under 2.2, which lacks
1748 timeit.py). Optionally a number of runs > 1 can be given for
1761 timeit.py). Optionally a number of runs > 1 can be given for
1749 timing very short-running code.
1762 timing very short-running code.
1750
1763
1751 * IPython/genutils.py (uniq_stable): new routine which returns a
1764 * IPython/genutils.py (uniq_stable): new routine which returns a
1752 list of unique elements in any iterable, but in stable order of
1765 list of unique elements in any iterable, but in stable order of
1753 appearance. I needed this for the ultraTB fixes, and it's a handy
1766 appearance. I needed this for the ultraTB fixes, and it's a handy
1754 utility.
1767 utility.
1755
1768
1756 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1769 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1757 dotted names in Verbose exceptions. This had been broken since
1770 dotted names in Verbose exceptions. This had been broken since
1758 the very start, now x.y will properly be printed in a Verbose
1771 the very start, now x.y will properly be printed in a Verbose
1759 traceback, instead of x being shown and y appearing always as an
1772 traceback, instead of x being shown and y appearing always as an
1760 'undefined global'. Getting this to work was a bit tricky,
1773 'undefined global'. Getting this to work was a bit tricky,
1761 because by default python tokenizers are stateless. Saved by
1774 because by default python tokenizers are stateless. Saved by
1762 python's ability to easily add a bit of state to an arbitrary
1775 python's ability to easily add a bit of state to an arbitrary
1763 function (without needing to build a full-blown callable object).
1776 function (without needing to build a full-blown callable object).
1764
1777
1765 Also big cleanup of this code, which had horrendous runtime
1778 Also big cleanup of this code, which had horrendous runtime
1766 lookups of zillions of attributes for colorization. Moved all
1779 lookups of zillions of attributes for colorization. Moved all
1767 this code into a few templates, which make it cleaner and quicker.
1780 this code into a few templates, which make it cleaner and quicker.
1768
1781
1769 Printout quality was also improved for Verbose exceptions: one
1782 Printout quality was also improved for Verbose exceptions: one
1770 variable per line, and memory addresses are printed (this can be
1783 variable per line, and memory addresses are printed (this can be
1771 quite handy in nasty debugging situations, which is what Verbose
1784 quite handy in nasty debugging situations, which is what Verbose
1772 is for).
1785 is for).
1773
1786
1774 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1787 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1775 the command line as scripts to be loaded by embedded instances.
1788 the command line as scripts to be loaded by embedded instances.
1776 Doing so has the potential for an infinite recursion if there are
1789 Doing so has the potential for an infinite recursion if there are
1777 exceptions thrown in the process. This fixes a strange crash
1790 exceptions thrown in the process. This fixes a strange crash
1778 reported by Philippe MULLER <muller-AT-irit.fr>.
1791 reported by Philippe MULLER <muller-AT-irit.fr>.
1779
1792
1780 2004-12-09 Fernando Perez <fperez@colorado.edu>
1793 2004-12-09 Fernando Perez <fperez@colorado.edu>
1781
1794
1782 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1795 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1783 to reflect new names in matplotlib, which now expose the
1796 to reflect new names in matplotlib, which now expose the
1784 matlab-compatible interface via a pylab module instead of the
1797 matlab-compatible interface via a pylab module instead of the
1785 'matlab' name. The new code is backwards compatible, so users of
1798 'matlab' name. The new code is backwards compatible, so users of
1786 all matplotlib versions are OK. Patch by J. Hunter.
1799 all matplotlib versions are OK. Patch by J. Hunter.
1787
1800
1788 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1801 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1789 of __init__ docstrings for instances (class docstrings are already
1802 of __init__ docstrings for instances (class docstrings are already
1790 automatically printed). Instances with customized docstrings
1803 automatically printed). Instances with customized docstrings
1791 (indep. of the class) are also recognized and all 3 separate
1804 (indep. of the class) are also recognized and all 3 separate
1792 docstrings are printed (instance, class, constructor). After some
1805 docstrings are printed (instance, class, constructor). After some
1793 comments/suggestions by J. Hunter.
1806 comments/suggestions by J. Hunter.
1794
1807
1795 2004-12-05 Fernando Perez <fperez@colorado.edu>
1808 2004-12-05 Fernando Perez <fperez@colorado.edu>
1796
1809
1797 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1810 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1798 warnings when tab-completion fails and triggers an exception.
1811 warnings when tab-completion fails and triggers an exception.
1799
1812
1800 2004-12-03 Fernando Perez <fperez@colorado.edu>
1813 2004-12-03 Fernando Perez <fperez@colorado.edu>
1801
1814
1802 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1815 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1803 be triggered when using 'run -p'. An incorrect option flag was
1816 be triggered when using 'run -p'. An incorrect option flag was
1804 being set ('d' instead of 'D').
1817 being set ('d' instead of 'D').
1805 (manpage): fix missing escaped \- sign.
1818 (manpage): fix missing escaped \- sign.
1806
1819
1807 2004-11-30 *** Released version 0.6.5
1820 2004-11-30 *** Released version 0.6.5
1808
1821
1809 2004-11-30 Fernando Perez <fperez@colorado.edu>
1822 2004-11-30 Fernando Perez <fperez@colorado.edu>
1810
1823
1811 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1824 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1812 setting with -d option.
1825 setting with -d option.
1813
1826
1814 * setup.py (docfiles): Fix problem where the doc glob I was using
1827 * setup.py (docfiles): Fix problem where the doc glob I was using
1815 was COMPLETELY BROKEN. It was giving the right files by pure
1828 was COMPLETELY BROKEN. It was giving the right files by pure
1816 accident, but failed once I tried to include ipython.el. Note:
1829 accident, but failed once I tried to include ipython.el. Note:
1817 glob() does NOT allow you to do exclusion on multiple endings!
1830 glob() does NOT allow you to do exclusion on multiple endings!
1818
1831
1819 2004-11-29 Fernando Perez <fperez@colorado.edu>
1832 2004-11-29 Fernando Perez <fperez@colorado.edu>
1820
1833
1821 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1834 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1822 the manpage as the source. Better formatting & consistency.
1835 the manpage as the source. Better formatting & consistency.
1823
1836
1824 * IPython/Magic.py (magic_run): Added new -d option, to run
1837 * IPython/Magic.py (magic_run): Added new -d option, to run
1825 scripts under the control of the python pdb debugger. Note that
1838 scripts under the control of the python pdb debugger. Note that
1826 this required changing the %prun option -d to -D, to avoid a clash
1839 this required changing the %prun option -d to -D, to avoid a clash
1827 (since %run must pass options to %prun, and getopt is too dumb to
1840 (since %run must pass options to %prun, and getopt is too dumb to
1828 handle options with string values with embedded spaces). Thanks
1841 handle options with string values with embedded spaces). Thanks
1829 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1842 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1830 (magic_who_ls): added type matching to %who and %whos, so that one
1843 (magic_who_ls): added type matching to %who and %whos, so that one
1831 can filter their output to only include variables of certain
1844 can filter their output to only include variables of certain
1832 types. Another suggestion by Matthew.
1845 types. Another suggestion by Matthew.
1833 (magic_whos): Added memory summaries in kb and Mb for arrays.
1846 (magic_whos): Added memory summaries in kb and Mb for arrays.
1834 (magic_who): Improve formatting (break lines every 9 vars).
1847 (magic_who): Improve formatting (break lines every 9 vars).
1835
1848
1836 2004-11-28 Fernando Perez <fperez@colorado.edu>
1849 2004-11-28 Fernando Perez <fperez@colorado.edu>
1837
1850
1838 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1851 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1839 cache when empty lines were present.
1852 cache when empty lines were present.
1840
1853
1841 2004-11-24 Fernando Perez <fperez@colorado.edu>
1854 2004-11-24 Fernando Perez <fperez@colorado.edu>
1842
1855
1843 * IPython/usage.py (__doc__): document the re-activated threading
1856 * IPython/usage.py (__doc__): document the re-activated threading
1844 options for WX and GTK.
1857 options for WX and GTK.
1845
1858
1846 2004-11-23 Fernando Perez <fperez@colorado.edu>
1859 2004-11-23 Fernando Perez <fperez@colorado.edu>
1847
1860
1848 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1861 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1849 the -wthread and -gthread options, along with a new -tk one to try
1862 the -wthread and -gthread options, along with a new -tk one to try
1850 and coordinate Tk threading with wx/gtk. The tk support is very
1863 and coordinate Tk threading with wx/gtk. The tk support is very
1851 platform dependent, since it seems to require Tcl and Tk to be
1864 platform dependent, since it seems to require Tcl and Tk to be
1852 built with threads (Fedora1/2 appears NOT to have it, but in
1865 built with threads (Fedora1/2 appears NOT to have it, but in
1853 Prabhu's Debian boxes it works OK). But even with some Tk
1866 Prabhu's Debian boxes it works OK). But even with some Tk
1854 limitations, this is a great improvement.
1867 limitations, this is a great improvement.
1855
1868
1856 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1869 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1857 info in user prompts. Patch by Prabhu.
1870 info in user prompts. Patch by Prabhu.
1858
1871
1859 2004-11-18 Fernando Perez <fperez@colorado.edu>
1872 2004-11-18 Fernando Perez <fperez@colorado.edu>
1860
1873
1861 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1874 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1862 EOFErrors and bail, to avoid infinite loops if a non-terminating
1875 EOFErrors and bail, to avoid infinite loops if a non-terminating
1863 file is fed into ipython. Patch submitted in issue 19 by user,
1876 file is fed into ipython. Patch submitted in issue 19 by user,
1864 many thanks.
1877 many thanks.
1865
1878
1866 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1879 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1867 autoquote/parens in continuation prompts, which can cause lots of
1880 autoquote/parens in continuation prompts, which can cause lots of
1868 problems. Closes roundup issue 20.
1881 problems. Closes roundup issue 20.
1869
1882
1870 2004-11-17 Fernando Perez <fperez@colorado.edu>
1883 2004-11-17 Fernando Perez <fperez@colorado.edu>
1871
1884
1872 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1885 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1873 reported as debian bug #280505. I'm not sure my local changelog
1886 reported as debian bug #280505. I'm not sure my local changelog
1874 entry has the proper debian format (Jack?).
1887 entry has the proper debian format (Jack?).
1875
1888
1876 2004-11-08 *** Released version 0.6.4
1889 2004-11-08 *** Released version 0.6.4
1877
1890
1878 2004-11-08 Fernando Perez <fperez@colorado.edu>
1891 2004-11-08 Fernando Perez <fperez@colorado.edu>
1879
1892
1880 * IPython/iplib.py (init_readline): Fix exit message for Windows
1893 * IPython/iplib.py (init_readline): Fix exit message for Windows
1881 when readline is active. Thanks to a report by Eric Jones
1894 when readline is active. Thanks to a report by Eric Jones
1882 <eric-AT-enthought.com>.
1895 <eric-AT-enthought.com>.
1883
1896
1884 2004-11-07 Fernando Perez <fperez@colorado.edu>
1897 2004-11-07 Fernando Perez <fperez@colorado.edu>
1885
1898
1886 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1899 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1887 sometimes seen by win2k/cygwin users.
1900 sometimes seen by win2k/cygwin users.
1888
1901
1889 2004-11-06 Fernando Perez <fperez@colorado.edu>
1902 2004-11-06 Fernando Perez <fperez@colorado.edu>
1890
1903
1891 * IPython/iplib.py (interact): Change the handling of %Exit from
1904 * IPython/iplib.py (interact): Change the handling of %Exit from
1892 trying to propagate a SystemExit to an internal ipython flag.
1905 trying to propagate a SystemExit to an internal ipython flag.
1893 This is less elegant than using Python's exception mechanism, but
1906 This is less elegant than using Python's exception mechanism, but
1894 I can't get that to work reliably with threads, so under -pylab
1907 I can't get that to work reliably with threads, so under -pylab
1895 %Exit was hanging IPython. Cross-thread exception handling is
1908 %Exit was hanging IPython. Cross-thread exception handling is
1896 really a bitch. Thaks to a bug report by Stephen Walton
1909 really a bitch. Thaks to a bug report by Stephen Walton
1897 <stephen.walton-AT-csun.edu>.
1910 <stephen.walton-AT-csun.edu>.
1898
1911
1899 2004-11-04 Fernando Perez <fperez@colorado.edu>
1912 2004-11-04 Fernando Perez <fperez@colorado.edu>
1900
1913
1901 * IPython/iplib.py (raw_input_original): store a pointer to the
1914 * IPython/iplib.py (raw_input_original): store a pointer to the
1902 true raw_input to harden against code which can modify it
1915 true raw_input to harden against code which can modify it
1903 (wx.py.PyShell does this and would otherwise crash ipython).
1916 (wx.py.PyShell does this and would otherwise crash ipython).
1904 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1917 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1905
1918
1906 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1919 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1907 Ctrl-C problem, which does not mess up the input line.
1920 Ctrl-C problem, which does not mess up the input line.
1908
1921
1909 2004-11-03 Fernando Perez <fperez@colorado.edu>
1922 2004-11-03 Fernando Perez <fperez@colorado.edu>
1910
1923
1911 * IPython/Release.py: Changed licensing to BSD, in all files.
1924 * IPython/Release.py: Changed licensing to BSD, in all files.
1912 (name): lowercase name for tarball/RPM release.
1925 (name): lowercase name for tarball/RPM release.
1913
1926
1914 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1927 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1915 use throughout ipython.
1928 use throughout ipython.
1916
1929
1917 * IPython/Magic.py (Magic._ofind): Switch to using the new
1930 * IPython/Magic.py (Magic._ofind): Switch to using the new
1918 OInspect.getdoc() function.
1931 OInspect.getdoc() function.
1919
1932
1920 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1933 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1921 of the line currently being canceled via Ctrl-C. It's extremely
1934 of the line currently being canceled via Ctrl-C. It's extremely
1922 ugly, but I don't know how to do it better (the problem is one of
1935 ugly, but I don't know how to do it better (the problem is one of
1923 handling cross-thread exceptions).
1936 handling cross-thread exceptions).
1924
1937
1925 2004-10-28 Fernando Perez <fperez@colorado.edu>
1938 2004-10-28 Fernando Perez <fperez@colorado.edu>
1926
1939
1927 * IPython/Shell.py (signal_handler): add signal handlers to trap
1940 * IPython/Shell.py (signal_handler): add signal handlers to trap
1928 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1941 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1929 report by Francesc Alted.
1942 report by Francesc Alted.
1930
1943
1931 2004-10-21 Fernando Perez <fperez@colorado.edu>
1944 2004-10-21 Fernando Perez <fperez@colorado.edu>
1932
1945
1933 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1946 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1934 to % for pysh syntax extensions.
1947 to % for pysh syntax extensions.
1935
1948
1936 2004-10-09 Fernando Perez <fperez@colorado.edu>
1949 2004-10-09 Fernando Perez <fperez@colorado.edu>
1937
1950
1938 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1951 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1939 arrays to print a more useful summary, without calling str(arr).
1952 arrays to print a more useful summary, without calling str(arr).
1940 This avoids the problem of extremely lengthy computations which
1953 This avoids the problem of extremely lengthy computations which
1941 occur if arr is large, and appear to the user as a system lockup
1954 occur if arr is large, and appear to the user as a system lockup
1942 with 100% cpu activity. After a suggestion by Kristian Sandberg
1955 with 100% cpu activity. After a suggestion by Kristian Sandberg
1943 <Kristian.Sandberg@colorado.edu>.
1956 <Kristian.Sandberg@colorado.edu>.
1944 (Magic.__init__): fix bug in global magic escapes not being
1957 (Magic.__init__): fix bug in global magic escapes not being
1945 correctly set.
1958 correctly set.
1946
1959
1947 2004-10-08 Fernando Perez <fperez@colorado.edu>
1960 2004-10-08 Fernando Perez <fperez@colorado.edu>
1948
1961
1949 * IPython/Magic.py (__license__): change to absolute imports of
1962 * IPython/Magic.py (__license__): change to absolute imports of
1950 ipython's own internal packages, to start adapting to the absolute
1963 ipython's own internal packages, to start adapting to the absolute
1951 import requirement of PEP-328.
1964 import requirement of PEP-328.
1952
1965
1953 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1966 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1954 files, and standardize author/license marks through the Release
1967 files, and standardize author/license marks through the Release
1955 module instead of having per/file stuff (except for files with
1968 module instead of having per/file stuff (except for files with
1956 particular licenses, like the MIT/PSF-licensed codes).
1969 particular licenses, like the MIT/PSF-licensed codes).
1957
1970
1958 * IPython/Debugger.py: remove dead code for python 2.1
1971 * IPython/Debugger.py: remove dead code for python 2.1
1959
1972
1960 2004-10-04 Fernando Perez <fperez@colorado.edu>
1973 2004-10-04 Fernando Perez <fperez@colorado.edu>
1961
1974
1962 * IPython/iplib.py (ipmagic): New function for accessing magics
1975 * IPython/iplib.py (ipmagic): New function for accessing magics
1963 via a normal python function call.
1976 via a normal python function call.
1964
1977
1965 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1978 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1966 from '@' to '%', to accomodate the new @decorator syntax of python
1979 from '@' to '%', to accomodate the new @decorator syntax of python
1967 2.4.
1980 2.4.
1968
1981
1969 2004-09-29 Fernando Perez <fperez@colorado.edu>
1982 2004-09-29 Fernando Perez <fperez@colorado.edu>
1970
1983
1971 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1984 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1972 matplotlib.use to prevent running scripts which try to switch
1985 matplotlib.use to prevent running scripts which try to switch
1973 interactive backends from within ipython. This will just crash
1986 interactive backends from within ipython. This will just crash
1974 the python interpreter, so we can't allow it (but a detailed error
1987 the python interpreter, so we can't allow it (but a detailed error
1975 is given to the user).
1988 is given to the user).
1976
1989
1977 2004-09-28 Fernando Perez <fperez@colorado.edu>
1990 2004-09-28 Fernando Perez <fperez@colorado.edu>
1978
1991
1979 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1992 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1980 matplotlib-related fixes so that using @run with non-matplotlib
1993 matplotlib-related fixes so that using @run with non-matplotlib
1981 scripts doesn't pop up spurious plot windows. This requires
1994 scripts doesn't pop up spurious plot windows. This requires
1982 matplotlib >= 0.63, where I had to make some changes as well.
1995 matplotlib >= 0.63, where I had to make some changes as well.
1983
1996
1984 * IPython/ipmaker.py (make_IPython): update version requirement to
1997 * IPython/ipmaker.py (make_IPython): update version requirement to
1985 python 2.2.
1998 python 2.2.
1986
1999
1987 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2000 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1988 banner arg for embedded customization.
2001 banner arg for embedded customization.
1989
2002
1990 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2003 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1991 explicit uses of __IP as the IPython's instance name. Now things
2004 explicit uses of __IP as the IPython's instance name. Now things
1992 are properly handled via the shell.name value. The actual code
2005 are properly handled via the shell.name value. The actual code
1993 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2006 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1994 is much better than before. I'll clean things completely when the
2007 is much better than before. I'll clean things completely when the
1995 magic stuff gets a real overhaul.
2008 magic stuff gets a real overhaul.
1996
2009
1997 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2010 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1998 minor changes to debian dir.
2011 minor changes to debian dir.
1999
2012
2000 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2013 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2001 pointer to the shell itself in the interactive namespace even when
2014 pointer to the shell itself in the interactive namespace even when
2002 a user-supplied dict is provided. This is needed for embedding
2015 a user-supplied dict is provided. This is needed for embedding
2003 purposes (found by tests with Michel Sanner).
2016 purposes (found by tests with Michel Sanner).
2004
2017
2005 2004-09-27 Fernando Perez <fperez@colorado.edu>
2018 2004-09-27 Fernando Perez <fperez@colorado.edu>
2006
2019
2007 * IPython/UserConfig/ipythonrc: remove []{} from
2020 * IPython/UserConfig/ipythonrc: remove []{} from
2008 readline_remove_delims, so that things like [modname.<TAB> do
2021 readline_remove_delims, so that things like [modname.<TAB> do
2009 proper completion. This disables [].TAB, but that's a less common
2022 proper completion. This disables [].TAB, but that's a less common
2010 case than module names in list comprehensions, for example.
2023 case than module names in list comprehensions, for example.
2011 Thanks to a report by Andrea Riciputi.
2024 Thanks to a report by Andrea Riciputi.
2012
2025
2013 2004-09-09 Fernando Perez <fperez@colorado.edu>
2026 2004-09-09 Fernando Perez <fperez@colorado.edu>
2014
2027
2015 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2028 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2016 blocking problems in win32 and osx. Fix by John.
2029 blocking problems in win32 and osx. Fix by John.
2017
2030
2018 2004-09-08 Fernando Perez <fperez@colorado.edu>
2031 2004-09-08 Fernando Perez <fperez@colorado.edu>
2019
2032
2020 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2033 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2021 for Win32 and OSX. Fix by John Hunter.
2034 for Win32 and OSX. Fix by John Hunter.
2022
2035
2023 2004-08-30 *** Released version 0.6.3
2036 2004-08-30 *** Released version 0.6.3
2024
2037
2025 2004-08-30 Fernando Perez <fperez@colorado.edu>
2038 2004-08-30 Fernando Perez <fperez@colorado.edu>
2026
2039
2027 * setup.py (isfile): Add manpages to list of dependent files to be
2040 * setup.py (isfile): Add manpages to list of dependent files to be
2028 updated.
2041 updated.
2029
2042
2030 2004-08-27 Fernando Perez <fperez@colorado.edu>
2043 2004-08-27 Fernando Perez <fperez@colorado.edu>
2031
2044
2032 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2045 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2033 for now. They don't really work with standalone WX/GTK code
2046 for now. They don't really work with standalone WX/GTK code
2034 (though matplotlib IS working fine with both of those backends).
2047 (though matplotlib IS working fine with both of those backends).
2035 This will neeed much more testing. I disabled most things with
2048 This will neeed much more testing. I disabled most things with
2036 comments, so turning it back on later should be pretty easy.
2049 comments, so turning it back on later should be pretty easy.
2037
2050
2038 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2051 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2039 autocalling of expressions like r'foo', by modifying the line
2052 autocalling of expressions like r'foo', by modifying the line
2040 split regexp. Closes
2053 split regexp. Closes
2041 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2054 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2042 Riley <ipythonbugs-AT-sabi.net>.
2055 Riley <ipythonbugs-AT-sabi.net>.
2043 (InteractiveShell.mainloop): honor --nobanner with banner
2056 (InteractiveShell.mainloop): honor --nobanner with banner
2044 extensions.
2057 extensions.
2045
2058
2046 * IPython/Shell.py: Significant refactoring of all classes, so
2059 * IPython/Shell.py: Significant refactoring of all classes, so
2047 that we can really support ALL matplotlib backends and threading
2060 that we can really support ALL matplotlib backends and threading
2048 models (John spotted a bug with Tk which required this). Now we
2061 models (John spotted a bug with Tk which required this). Now we
2049 should support single-threaded, WX-threads and GTK-threads, both
2062 should support single-threaded, WX-threads and GTK-threads, both
2050 for generic code and for matplotlib.
2063 for generic code and for matplotlib.
2051
2064
2052 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2065 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2053 -pylab, to simplify things for users. Will also remove the pylab
2066 -pylab, to simplify things for users. Will also remove the pylab
2054 profile, since now all of matplotlib configuration is directly
2067 profile, since now all of matplotlib configuration is directly
2055 handled here. This also reduces startup time.
2068 handled here. This also reduces startup time.
2056
2069
2057 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2070 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2058 shell wasn't being correctly called. Also in IPShellWX.
2071 shell wasn't being correctly called. Also in IPShellWX.
2059
2072
2060 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2073 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2061 fine-tune banner.
2074 fine-tune banner.
2062
2075
2063 * IPython/numutils.py (spike): Deprecate these spike functions,
2076 * IPython/numutils.py (spike): Deprecate these spike functions,
2064 delete (long deprecated) gnuplot_exec handler.
2077 delete (long deprecated) gnuplot_exec handler.
2065
2078
2066 2004-08-26 Fernando Perez <fperez@colorado.edu>
2079 2004-08-26 Fernando Perez <fperez@colorado.edu>
2067
2080
2068 * ipython.1: Update for threading options, plus some others which
2081 * ipython.1: Update for threading options, plus some others which
2069 were missing.
2082 were missing.
2070
2083
2071 * IPython/ipmaker.py (__call__): Added -wthread option for
2084 * IPython/ipmaker.py (__call__): Added -wthread option for
2072 wxpython thread handling. Make sure threading options are only
2085 wxpython thread handling. Make sure threading options are only
2073 valid at the command line.
2086 valid at the command line.
2074
2087
2075 * scripts/ipython: moved shell selection into a factory function
2088 * scripts/ipython: moved shell selection into a factory function
2076 in Shell.py, to keep the starter script to a minimum.
2089 in Shell.py, to keep the starter script to a minimum.
2077
2090
2078 2004-08-25 Fernando Perez <fperez@colorado.edu>
2091 2004-08-25 Fernando Perez <fperez@colorado.edu>
2079
2092
2080 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2093 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2081 John. Along with some recent changes he made to matplotlib, the
2094 John. Along with some recent changes he made to matplotlib, the
2082 next versions of both systems should work very well together.
2095 next versions of both systems should work very well together.
2083
2096
2084 2004-08-24 Fernando Perez <fperez@colorado.edu>
2097 2004-08-24 Fernando Perez <fperez@colorado.edu>
2085
2098
2086 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2099 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2087 tried to switch the profiling to using hotshot, but I'm getting
2100 tried to switch the profiling to using hotshot, but I'm getting
2088 strange errors from prof.runctx() there. I may be misreading the
2101 strange errors from prof.runctx() there. I may be misreading the
2089 docs, but it looks weird. For now the profiling code will
2102 docs, but it looks weird. For now the profiling code will
2090 continue to use the standard profiler.
2103 continue to use the standard profiler.
2091
2104
2092 2004-08-23 Fernando Perez <fperez@colorado.edu>
2105 2004-08-23 Fernando Perez <fperez@colorado.edu>
2093
2106
2094 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2107 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2095 threaded shell, by John Hunter. It's not quite ready yet, but
2108 threaded shell, by John Hunter. It's not quite ready yet, but
2096 close.
2109 close.
2097
2110
2098 2004-08-22 Fernando Perez <fperez@colorado.edu>
2111 2004-08-22 Fernando Perez <fperez@colorado.edu>
2099
2112
2100 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2113 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2101 in Magic and ultraTB.
2114 in Magic and ultraTB.
2102
2115
2103 * ipython.1: document threading options in manpage.
2116 * ipython.1: document threading options in manpage.
2104
2117
2105 * scripts/ipython: Changed name of -thread option to -gthread,
2118 * scripts/ipython: Changed name of -thread option to -gthread,
2106 since this is GTK specific. I want to leave the door open for a
2119 since this is GTK specific. I want to leave the door open for a
2107 -wthread option for WX, which will most likely be necessary. This
2120 -wthread option for WX, which will most likely be necessary. This
2108 change affects usage and ipmaker as well.
2121 change affects usage and ipmaker as well.
2109
2122
2110 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2123 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2111 handle the matplotlib shell issues. Code by John Hunter
2124 handle the matplotlib shell issues. Code by John Hunter
2112 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2125 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2113 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2126 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2114 broken (and disabled for end users) for now, but it puts the
2127 broken (and disabled for end users) for now, but it puts the
2115 infrastructure in place.
2128 infrastructure in place.
2116
2129
2117 2004-08-21 Fernando Perez <fperez@colorado.edu>
2130 2004-08-21 Fernando Perez <fperez@colorado.edu>
2118
2131
2119 * ipythonrc-pylab: Add matplotlib support.
2132 * ipythonrc-pylab: Add matplotlib support.
2120
2133
2121 * matplotlib_config.py: new files for matplotlib support, part of
2134 * matplotlib_config.py: new files for matplotlib support, part of
2122 the pylab profile.
2135 the pylab profile.
2123
2136
2124 * IPython/usage.py (__doc__): documented the threading options.
2137 * IPython/usage.py (__doc__): documented the threading options.
2125
2138
2126 2004-08-20 Fernando Perez <fperez@colorado.edu>
2139 2004-08-20 Fernando Perez <fperez@colorado.edu>
2127
2140
2128 * ipython: Modified the main calling routine to handle the -thread
2141 * ipython: Modified the main calling routine to handle the -thread
2129 and -mpthread options. This needs to be done as a top-level hack,
2142 and -mpthread options. This needs to be done as a top-level hack,
2130 because it determines which class to instantiate for IPython
2143 because it determines which class to instantiate for IPython
2131 itself.
2144 itself.
2132
2145
2133 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2146 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2134 classes to support multithreaded GTK operation without blocking,
2147 classes to support multithreaded GTK operation without blocking,
2135 and matplotlib with all backends. This is a lot of still very
2148 and matplotlib with all backends. This is a lot of still very
2136 experimental code, and threads are tricky. So it may still have a
2149 experimental code, and threads are tricky. So it may still have a
2137 few rough edges... This code owes a lot to
2150 few rough edges... This code owes a lot to
2138 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2151 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2139 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2152 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2140 to John Hunter for all the matplotlib work.
2153 to John Hunter for all the matplotlib work.
2141
2154
2142 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2155 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2143 options for gtk thread and matplotlib support.
2156 options for gtk thread and matplotlib support.
2144
2157
2145 2004-08-16 Fernando Perez <fperez@colorado.edu>
2158 2004-08-16 Fernando Perez <fperez@colorado.edu>
2146
2159
2147 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2160 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2148 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2161 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2149 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2162 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2150
2163
2151 2004-08-11 Fernando Perez <fperez@colorado.edu>
2164 2004-08-11 Fernando Perez <fperez@colorado.edu>
2152
2165
2153 * setup.py (isfile): Fix build so documentation gets updated for
2166 * setup.py (isfile): Fix build so documentation gets updated for
2154 rpms (it was only done for .tgz builds).
2167 rpms (it was only done for .tgz builds).
2155
2168
2156 2004-08-10 Fernando Perez <fperez@colorado.edu>
2169 2004-08-10 Fernando Perez <fperez@colorado.edu>
2157
2170
2158 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2171 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2159
2172
2160 * iplib.py : Silence syntax error exceptions in tab-completion.
2173 * iplib.py : Silence syntax error exceptions in tab-completion.
2161
2174
2162 2004-08-05 Fernando Perez <fperez@colorado.edu>
2175 2004-08-05 Fernando Perez <fperez@colorado.edu>
2163
2176
2164 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2177 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2165 'color off' mark for continuation prompts. This was causing long
2178 'color off' mark for continuation prompts. This was causing long
2166 continuation lines to mis-wrap.
2179 continuation lines to mis-wrap.
2167
2180
2168 2004-08-01 Fernando Perez <fperez@colorado.edu>
2181 2004-08-01 Fernando Perez <fperez@colorado.edu>
2169
2182
2170 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2183 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2171 for building ipython to be a parameter. All this is necessary
2184 for building ipython to be a parameter. All this is necessary
2172 right now to have a multithreaded version, but this insane
2185 right now to have a multithreaded version, but this insane
2173 non-design will be cleaned up soon. For now, it's a hack that
2186 non-design will be cleaned up soon. For now, it's a hack that
2174 works.
2187 works.
2175
2188
2176 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2189 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2177 args in various places. No bugs so far, but it's a dangerous
2190 args in various places. No bugs so far, but it's a dangerous
2178 practice.
2191 practice.
2179
2192
2180 2004-07-31 Fernando Perez <fperez@colorado.edu>
2193 2004-07-31 Fernando Perez <fperez@colorado.edu>
2181
2194
2182 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2195 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2183 fix completion of files with dots in their names under most
2196 fix completion of files with dots in their names under most
2184 profiles (pysh was OK because the completion order is different).
2197 profiles (pysh was OK because the completion order is different).
2185
2198
2186 2004-07-27 Fernando Perez <fperez@colorado.edu>
2199 2004-07-27 Fernando Perez <fperez@colorado.edu>
2187
2200
2188 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2201 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2189 keywords manually, b/c the one in keyword.py was removed in python
2202 keywords manually, b/c the one in keyword.py was removed in python
2190 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2203 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2191 This is NOT a bug under python 2.3 and earlier.
2204 This is NOT a bug under python 2.3 and earlier.
2192
2205
2193 2004-07-26 Fernando Perez <fperez@colorado.edu>
2206 2004-07-26 Fernando Perez <fperez@colorado.edu>
2194
2207
2195 * IPython/ultraTB.py (VerboseTB.text): Add another
2208 * IPython/ultraTB.py (VerboseTB.text): Add another
2196 linecache.checkcache() call to try to prevent inspect.py from
2209 linecache.checkcache() call to try to prevent inspect.py from
2197 crashing under python 2.3. I think this fixes
2210 crashing under python 2.3. I think this fixes
2198 http://www.scipy.net/roundup/ipython/issue17.
2211 http://www.scipy.net/roundup/ipython/issue17.
2199
2212
2200 2004-07-26 *** Released version 0.6.2
2213 2004-07-26 *** Released version 0.6.2
2201
2214
2202 2004-07-26 Fernando Perez <fperez@colorado.edu>
2215 2004-07-26 Fernando Perez <fperez@colorado.edu>
2203
2216
2204 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2217 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2205 fail for any number.
2218 fail for any number.
2206 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2219 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2207 empty bookmarks.
2220 empty bookmarks.
2208
2221
2209 2004-07-26 *** Released version 0.6.1
2222 2004-07-26 *** Released version 0.6.1
2210
2223
2211 2004-07-26 Fernando Perez <fperez@colorado.edu>
2224 2004-07-26 Fernando Perez <fperez@colorado.edu>
2212
2225
2213 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2226 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2214
2227
2215 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2228 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2216 escaping '()[]{}' in filenames.
2229 escaping '()[]{}' in filenames.
2217
2230
2218 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2231 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2219 Python 2.2 users who lack a proper shlex.split.
2232 Python 2.2 users who lack a proper shlex.split.
2220
2233
2221 2004-07-19 Fernando Perez <fperez@colorado.edu>
2234 2004-07-19 Fernando Perez <fperez@colorado.edu>
2222
2235
2223 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2236 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2224 for reading readline's init file. I follow the normal chain:
2237 for reading readline's init file. I follow the normal chain:
2225 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2238 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2226 report by Mike Heeter. This closes
2239 report by Mike Heeter. This closes
2227 http://www.scipy.net/roundup/ipython/issue16.
2240 http://www.scipy.net/roundup/ipython/issue16.
2228
2241
2229 2004-07-18 Fernando Perez <fperez@colorado.edu>
2242 2004-07-18 Fernando Perez <fperez@colorado.edu>
2230
2243
2231 * IPython/iplib.py (__init__): Add better handling of '\' under
2244 * IPython/iplib.py (__init__): Add better handling of '\' under
2232 Win32 for filenames. After a patch by Ville.
2245 Win32 for filenames. After a patch by Ville.
2233
2246
2234 2004-07-17 Fernando Perez <fperez@colorado.edu>
2247 2004-07-17 Fernando Perez <fperez@colorado.edu>
2235
2248
2236 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2249 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2237 autocalling would be triggered for 'foo is bar' if foo is
2250 autocalling would be triggered for 'foo is bar' if foo is
2238 callable. I also cleaned up the autocall detection code to use a
2251 callable. I also cleaned up the autocall detection code to use a
2239 regexp, which is faster. Bug reported by Alexander Schmolck.
2252 regexp, which is faster. Bug reported by Alexander Schmolck.
2240
2253
2241 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2254 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2242 '?' in them would confuse the help system. Reported by Alex
2255 '?' in them would confuse the help system. Reported by Alex
2243 Schmolck.
2256 Schmolck.
2244
2257
2245 2004-07-16 Fernando Perez <fperez@colorado.edu>
2258 2004-07-16 Fernando Perez <fperez@colorado.edu>
2246
2259
2247 * IPython/GnuplotInteractive.py (__all__): added plot2.
2260 * IPython/GnuplotInteractive.py (__all__): added plot2.
2248
2261
2249 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2262 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2250 plotting dictionaries, lists or tuples of 1d arrays.
2263 plotting dictionaries, lists or tuples of 1d arrays.
2251
2264
2252 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2265 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2253 optimizations.
2266 optimizations.
2254
2267
2255 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2268 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2256 the information which was there from Janko's original IPP code:
2269 the information which was there from Janko's original IPP code:
2257
2270
2258 03.05.99 20:53 porto.ifm.uni-kiel.de
2271 03.05.99 20:53 porto.ifm.uni-kiel.de
2259 --Started changelog.
2272 --Started changelog.
2260 --make clear do what it say it does
2273 --make clear do what it say it does
2261 --added pretty output of lines from inputcache
2274 --added pretty output of lines from inputcache
2262 --Made Logger a mixin class, simplifies handling of switches
2275 --Made Logger a mixin class, simplifies handling of switches
2263 --Added own completer class. .string<TAB> expands to last history
2276 --Added own completer class. .string<TAB> expands to last history
2264 line which starts with string. The new expansion is also present
2277 line which starts with string. The new expansion is also present
2265 with Ctrl-r from the readline library. But this shows, who this
2278 with Ctrl-r from the readline library. But this shows, who this
2266 can be done for other cases.
2279 can be done for other cases.
2267 --Added convention that all shell functions should accept a
2280 --Added convention that all shell functions should accept a
2268 parameter_string This opens the door for different behaviour for
2281 parameter_string This opens the door for different behaviour for
2269 each function. @cd is a good example of this.
2282 each function. @cd is a good example of this.
2270
2283
2271 04.05.99 12:12 porto.ifm.uni-kiel.de
2284 04.05.99 12:12 porto.ifm.uni-kiel.de
2272 --added logfile rotation
2285 --added logfile rotation
2273 --added new mainloop method which freezes first the namespace
2286 --added new mainloop method which freezes first the namespace
2274
2287
2275 07.05.99 21:24 porto.ifm.uni-kiel.de
2288 07.05.99 21:24 porto.ifm.uni-kiel.de
2276 --added the docreader classes. Now there is a help system.
2289 --added the docreader classes. Now there is a help system.
2277 -This is only a first try. Currently it's not easy to put new
2290 -This is only a first try. Currently it's not easy to put new
2278 stuff in the indices. But this is the way to go. Info would be
2291 stuff in the indices. But this is the way to go. Info would be
2279 better, but HTML is every where and not everybody has an info
2292 better, but HTML is every where and not everybody has an info
2280 system installed and it's not so easy to change html-docs to info.
2293 system installed and it's not so easy to change html-docs to info.
2281 --added global logfile option
2294 --added global logfile option
2282 --there is now a hook for object inspection method pinfo needs to
2295 --there is now a hook for object inspection method pinfo needs to
2283 be provided for this. Can be reached by two '??'.
2296 be provided for this. Can be reached by two '??'.
2284
2297
2285 08.05.99 20:51 porto.ifm.uni-kiel.de
2298 08.05.99 20:51 porto.ifm.uni-kiel.de
2286 --added a README
2299 --added a README
2287 --bug in rc file. Something has changed so functions in the rc
2300 --bug in rc file. Something has changed so functions in the rc
2288 file need to reference the shell and not self. Not clear if it's a
2301 file need to reference the shell and not self. Not clear if it's a
2289 bug or feature.
2302 bug or feature.
2290 --changed rc file for new behavior
2303 --changed rc file for new behavior
2291
2304
2292 2004-07-15 Fernando Perez <fperez@colorado.edu>
2305 2004-07-15 Fernando Perez <fperez@colorado.edu>
2293
2306
2294 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2307 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2295 cache was falling out of sync in bizarre manners when multi-line
2308 cache was falling out of sync in bizarre manners when multi-line
2296 input was present. Minor optimizations and cleanup.
2309 input was present. Minor optimizations and cleanup.
2297
2310
2298 (Logger): Remove old Changelog info for cleanup. This is the
2311 (Logger): Remove old Changelog info for cleanup. This is the
2299 information which was there from Janko's original code:
2312 information which was there from Janko's original code:
2300
2313
2301 Changes to Logger: - made the default log filename a parameter
2314 Changes to Logger: - made the default log filename a parameter
2302
2315
2303 - put a check for lines beginning with !@? in log(). Needed
2316 - put a check for lines beginning with !@? in log(). Needed
2304 (even if the handlers properly log their lines) for mid-session
2317 (even if the handlers properly log their lines) for mid-session
2305 logging activation to work properly. Without this, lines logged
2318 logging activation to work properly. Without this, lines logged
2306 in mid session, which get read from the cache, would end up
2319 in mid session, which get read from the cache, would end up
2307 'bare' (with !@? in the open) in the log. Now they are caught
2320 'bare' (with !@? in the open) in the log. Now they are caught
2308 and prepended with a #.
2321 and prepended with a #.
2309
2322
2310 * IPython/iplib.py (InteractiveShell.init_readline): added check
2323 * IPython/iplib.py (InteractiveShell.init_readline): added check
2311 in case MagicCompleter fails to be defined, so we don't crash.
2324 in case MagicCompleter fails to be defined, so we don't crash.
2312
2325
2313 2004-07-13 Fernando Perez <fperez@colorado.edu>
2326 2004-07-13 Fernando Perez <fperez@colorado.edu>
2314
2327
2315 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2328 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2316 of EPS if the requested filename ends in '.eps'.
2329 of EPS if the requested filename ends in '.eps'.
2317
2330
2318 2004-07-04 Fernando Perez <fperez@colorado.edu>
2331 2004-07-04 Fernando Perez <fperez@colorado.edu>
2319
2332
2320 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2333 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2321 escaping of quotes when calling the shell.
2334 escaping of quotes when calling the shell.
2322
2335
2323 2004-07-02 Fernando Perez <fperez@colorado.edu>
2336 2004-07-02 Fernando Perez <fperez@colorado.edu>
2324
2337
2325 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2338 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2326 gettext not working because we were clobbering '_'. Fixes
2339 gettext not working because we were clobbering '_'. Fixes
2327 http://www.scipy.net/roundup/ipython/issue6.
2340 http://www.scipy.net/roundup/ipython/issue6.
2328
2341
2329 2004-07-01 Fernando Perez <fperez@colorado.edu>
2342 2004-07-01 Fernando Perez <fperez@colorado.edu>
2330
2343
2331 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2344 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2332 into @cd. Patch by Ville.
2345 into @cd. Patch by Ville.
2333
2346
2334 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2347 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2335 new function to store things after ipmaker runs. Patch by Ville.
2348 new function to store things after ipmaker runs. Patch by Ville.
2336 Eventually this will go away once ipmaker is removed and the class
2349 Eventually this will go away once ipmaker is removed and the class
2337 gets cleaned up, but for now it's ok. Key functionality here is
2350 gets cleaned up, but for now it's ok. Key functionality here is
2338 the addition of the persistent storage mechanism, a dict for
2351 the addition of the persistent storage mechanism, a dict for
2339 keeping data across sessions (for now just bookmarks, but more can
2352 keeping data across sessions (for now just bookmarks, but more can
2340 be implemented later).
2353 be implemented later).
2341
2354
2342 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2355 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2343 persistent across sections. Patch by Ville, I modified it
2356 persistent across sections. Patch by Ville, I modified it
2344 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2357 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2345 added a '-l' option to list all bookmarks.
2358 added a '-l' option to list all bookmarks.
2346
2359
2347 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2360 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2348 center for cleanup. Registered with atexit.register(). I moved
2361 center for cleanup. Registered with atexit.register(). I moved
2349 here the old exit_cleanup(). After a patch by Ville.
2362 here the old exit_cleanup(). After a patch by Ville.
2350
2363
2351 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2364 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2352 characters in the hacked shlex_split for python 2.2.
2365 characters in the hacked shlex_split for python 2.2.
2353
2366
2354 * IPython/iplib.py (file_matches): more fixes to filenames with
2367 * IPython/iplib.py (file_matches): more fixes to filenames with
2355 whitespace in them. It's not perfect, but limitations in python's
2368 whitespace in them. It's not perfect, but limitations in python's
2356 readline make it impossible to go further.
2369 readline make it impossible to go further.
2357
2370
2358 2004-06-29 Fernando Perez <fperez@colorado.edu>
2371 2004-06-29 Fernando Perez <fperez@colorado.edu>
2359
2372
2360 * IPython/iplib.py (file_matches): escape whitespace correctly in
2373 * IPython/iplib.py (file_matches): escape whitespace correctly in
2361 filename completions. Bug reported by Ville.
2374 filename completions. Bug reported by Ville.
2362
2375
2363 2004-06-28 Fernando Perez <fperez@colorado.edu>
2376 2004-06-28 Fernando Perez <fperez@colorado.edu>
2364
2377
2365 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2378 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2366 the history file will be called 'history-PROFNAME' (or just
2379 the history file will be called 'history-PROFNAME' (or just
2367 'history' if no profile is loaded). I was getting annoyed at
2380 'history' if no profile is loaded). I was getting annoyed at
2368 getting my Numerical work history clobbered by pysh sessions.
2381 getting my Numerical work history clobbered by pysh sessions.
2369
2382
2370 * IPython/iplib.py (InteractiveShell.__init__): Internal
2383 * IPython/iplib.py (InteractiveShell.__init__): Internal
2371 getoutputerror() function so that we can honor the system_verbose
2384 getoutputerror() function so that we can honor the system_verbose
2372 flag for _all_ system calls. I also added escaping of #
2385 flag for _all_ system calls. I also added escaping of #
2373 characters here to avoid confusing Itpl.
2386 characters here to avoid confusing Itpl.
2374
2387
2375 * IPython/Magic.py (shlex_split): removed call to shell in
2388 * IPython/Magic.py (shlex_split): removed call to shell in
2376 parse_options and replaced it with shlex.split(). The annoying
2389 parse_options and replaced it with shlex.split(). The annoying
2377 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2390 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2378 to backport it from 2.3, with several frail hacks (the shlex
2391 to backport it from 2.3, with several frail hacks (the shlex
2379 module is rather limited in 2.2). Thanks to a suggestion by Ville
2392 module is rather limited in 2.2). Thanks to a suggestion by Ville
2380 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2393 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2381 problem.
2394 problem.
2382
2395
2383 (Magic.magic_system_verbose): new toggle to print the actual
2396 (Magic.magic_system_verbose): new toggle to print the actual
2384 system calls made by ipython. Mainly for debugging purposes.
2397 system calls made by ipython. Mainly for debugging purposes.
2385
2398
2386 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2399 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2387 doesn't support persistence. Reported (and fix suggested) by
2400 doesn't support persistence. Reported (and fix suggested) by
2388 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2401 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2389
2402
2390 2004-06-26 Fernando Perez <fperez@colorado.edu>
2403 2004-06-26 Fernando Perez <fperez@colorado.edu>
2391
2404
2392 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2405 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2393 continue prompts.
2406 continue prompts.
2394
2407
2395 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2408 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2396 function (basically a big docstring) and a few more things here to
2409 function (basically a big docstring) and a few more things here to
2397 speedup startup. pysh.py is now very lightweight. We want because
2410 speedup startup. pysh.py is now very lightweight. We want because
2398 it gets execfile'd, while InterpreterExec gets imported, so
2411 it gets execfile'd, while InterpreterExec gets imported, so
2399 byte-compilation saves time.
2412 byte-compilation saves time.
2400
2413
2401 2004-06-25 Fernando Perez <fperez@colorado.edu>
2414 2004-06-25 Fernando Perez <fperez@colorado.edu>
2402
2415
2403 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2416 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2404 -NUM', which was recently broken.
2417 -NUM', which was recently broken.
2405
2418
2406 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2419 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2407 in multi-line input (but not !!, which doesn't make sense there).
2420 in multi-line input (but not !!, which doesn't make sense there).
2408
2421
2409 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2422 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2410 It's just too useful, and people can turn it off in the less
2423 It's just too useful, and people can turn it off in the less
2411 common cases where it's a problem.
2424 common cases where it's a problem.
2412
2425
2413 2004-06-24 Fernando Perez <fperez@colorado.edu>
2426 2004-06-24 Fernando Perez <fperez@colorado.edu>
2414
2427
2415 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2428 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2416 special syntaxes (like alias calling) is now allied in multi-line
2429 special syntaxes (like alias calling) is now allied in multi-line
2417 input. This is still _very_ experimental, but it's necessary for
2430 input. This is still _very_ experimental, but it's necessary for
2418 efficient shell usage combining python looping syntax with system
2431 efficient shell usage combining python looping syntax with system
2419 calls. For now it's restricted to aliases, I don't think it
2432 calls. For now it's restricted to aliases, I don't think it
2420 really even makes sense to have this for magics.
2433 really even makes sense to have this for magics.
2421
2434
2422 2004-06-23 Fernando Perez <fperez@colorado.edu>
2435 2004-06-23 Fernando Perez <fperez@colorado.edu>
2423
2436
2424 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2437 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2425 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2438 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2426
2439
2427 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2440 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2428 extensions under Windows (after code sent by Gary Bishop). The
2441 extensions under Windows (after code sent by Gary Bishop). The
2429 extensions considered 'executable' are stored in IPython's rc
2442 extensions considered 'executable' are stored in IPython's rc
2430 structure as win_exec_ext.
2443 structure as win_exec_ext.
2431
2444
2432 * IPython/genutils.py (shell): new function, like system() but
2445 * IPython/genutils.py (shell): new function, like system() but
2433 without return value. Very useful for interactive shell work.
2446 without return value. Very useful for interactive shell work.
2434
2447
2435 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2448 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2436 delete aliases.
2449 delete aliases.
2437
2450
2438 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2451 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2439 sure that the alias table doesn't contain python keywords.
2452 sure that the alias table doesn't contain python keywords.
2440
2453
2441 2004-06-21 Fernando Perez <fperez@colorado.edu>
2454 2004-06-21 Fernando Perez <fperez@colorado.edu>
2442
2455
2443 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2456 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2444 non-existent items are found in $PATH. Reported by Thorsten.
2457 non-existent items are found in $PATH. Reported by Thorsten.
2445
2458
2446 2004-06-20 Fernando Perez <fperez@colorado.edu>
2459 2004-06-20 Fernando Perez <fperez@colorado.edu>
2447
2460
2448 * IPython/iplib.py (complete): modified the completer so that the
2461 * IPython/iplib.py (complete): modified the completer so that the
2449 order of priorities can be easily changed at runtime.
2462 order of priorities can be easily changed at runtime.
2450
2463
2451 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2464 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2452 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2465 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2453
2466
2454 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2467 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2455 expand Python variables prepended with $ in all system calls. The
2468 expand Python variables prepended with $ in all system calls. The
2456 same was done to InteractiveShell.handle_shell_escape. Now all
2469 same was done to InteractiveShell.handle_shell_escape. Now all
2457 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2470 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2458 expansion of python variables and expressions according to the
2471 expansion of python variables and expressions according to the
2459 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2472 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2460
2473
2461 Though PEP-215 has been rejected, a similar (but simpler) one
2474 Though PEP-215 has been rejected, a similar (but simpler) one
2462 seems like it will go into Python 2.4, PEP-292 -
2475 seems like it will go into Python 2.4, PEP-292 -
2463 http://www.python.org/peps/pep-0292.html.
2476 http://www.python.org/peps/pep-0292.html.
2464
2477
2465 I'll keep the full syntax of PEP-215, since IPython has since the
2478 I'll keep the full syntax of PEP-215, since IPython has since the
2466 start used Ka-Ping Yee's reference implementation discussed there
2479 start used Ka-Ping Yee's reference implementation discussed there
2467 (Itpl), and I actually like the powerful semantics it offers.
2480 (Itpl), and I actually like the powerful semantics it offers.
2468
2481
2469 In order to access normal shell variables, the $ has to be escaped
2482 In order to access normal shell variables, the $ has to be escaped
2470 via an extra $. For example:
2483 via an extra $. For example:
2471
2484
2472 In [7]: PATH='a python variable'
2485 In [7]: PATH='a python variable'
2473
2486
2474 In [8]: !echo $PATH
2487 In [8]: !echo $PATH
2475 a python variable
2488 a python variable
2476
2489
2477 In [9]: !echo $$PATH
2490 In [9]: !echo $$PATH
2478 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2491 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2479
2492
2480 (Magic.parse_options): escape $ so the shell doesn't evaluate
2493 (Magic.parse_options): escape $ so the shell doesn't evaluate
2481 things prematurely.
2494 things prematurely.
2482
2495
2483 * IPython/iplib.py (InteractiveShell.call_alias): added the
2496 * IPython/iplib.py (InteractiveShell.call_alias): added the
2484 ability for aliases to expand python variables via $.
2497 ability for aliases to expand python variables via $.
2485
2498
2486 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2499 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2487 system, now there's a @rehash/@rehashx pair of magics. These work
2500 system, now there's a @rehash/@rehashx pair of magics. These work
2488 like the csh rehash command, and can be invoked at any time. They
2501 like the csh rehash command, and can be invoked at any time. They
2489 build a table of aliases to everything in the user's $PATH
2502 build a table of aliases to everything in the user's $PATH
2490 (@rehash uses everything, @rehashx is slower but only adds
2503 (@rehash uses everything, @rehashx is slower but only adds
2491 executable files). With this, the pysh.py-based shell profile can
2504 executable files). With this, the pysh.py-based shell profile can
2492 now simply call rehash upon startup, and full access to all
2505 now simply call rehash upon startup, and full access to all
2493 programs in the user's path is obtained.
2506 programs in the user's path is obtained.
2494
2507
2495 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2508 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2496 functionality is now fully in place. I removed the old dynamic
2509 functionality is now fully in place. I removed the old dynamic
2497 code generation based approach, in favor of a much lighter one
2510 code generation based approach, in favor of a much lighter one
2498 based on a simple dict. The advantage is that this allows me to
2511 based on a simple dict. The advantage is that this allows me to
2499 now have thousands of aliases with negligible cost (unthinkable
2512 now have thousands of aliases with negligible cost (unthinkable
2500 with the old system).
2513 with the old system).
2501
2514
2502 2004-06-19 Fernando Perez <fperez@colorado.edu>
2515 2004-06-19 Fernando Perez <fperez@colorado.edu>
2503
2516
2504 * IPython/iplib.py (__init__): extended MagicCompleter class to
2517 * IPython/iplib.py (__init__): extended MagicCompleter class to
2505 also complete (last in priority) on user aliases.
2518 also complete (last in priority) on user aliases.
2506
2519
2507 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2520 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2508 call to eval.
2521 call to eval.
2509 (ItplNS.__init__): Added a new class which functions like Itpl,
2522 (ItplNS.__init__): Added a new class which functions like Itpl,
2510 but allows configuring the namespace for the evaluation to occur
2523 but allows configuring the namespace for the evaluation to occur
2511 in.
2524 in.
2512
2525
2513 2004-06-18 Fernando Perez <fperez@colorado.edu>
2526 2004-06-18 Fernando Perez <fperez@colorado.edu>
2514
2527
2515 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2528 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2516 better message when 'exit' or 'quit' are typed (a common newbie
2529 better message when 'exit' or 'quit' are typed (a common newbie
2517 confusion).
2530 confusion).
2518
2531
2519 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2532 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2520 check for Windows users.
2533 check for Windows users.
2521
2534
2522 * IPython/iplib.py (InteractiveShell.user_setup): removed
2535 * IPython/iplib.py (InteractiveShell.user_setup): removed
2523 disabling of colors for Windows. I'll test at runtime and issue a
2536 disabling of colors for Windows. I'll test at runtime and issue a
2524 warning if Gary's readline isn't found, as to nudge users to
2537 warning if Gary's readline isn't found, as to nudge users to
2525 download it.
2538 download it.
2526
2539
2527 2004-06-16 Fernando Perez <fperez@colorado.edu>
2540 2004-06-16 Fernando Perez <fperez@colorado.edu>
2528
2541
2529 * IPython/genutils.py (Stream.__init__): changed to print errors
2542 * IPython/genutils.py (Stream.__init__): changed to print errors
2530 to sys.stderr. I had a circular dependency here. Now it's
2543 to sys.stderr. I had a circular dependency here. Now it's
2531 possible to run ipython as IDLE's shell (consider this pre-alpha,
2544 possible to run ipython as IDLE's shell (consider this pre-alpha,
2532 since true stdout things end up in the starting terminal instead
2545 since true stdout things end up in the starting terminal instead
2533 of IDLE's out).
2546 of IDLE's out).
2534
2547
2535 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2548 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2536 users who haven't # updated their prompt_in2 definitions. Remove
2549 users who haven't # updated their prompt_in2 definitions. Remove
2537 eventually.
2550 eventually.
2538 (multiple_replace): added credit to original ASPN recipe.
2551 (multiple_replace): added credit to original ASPN recipe.
2539
2552
2540 2004-06-15 Fernando Perez <fperez@colorado.edu>
2553 2004-06-15 Fernando Perez <fperez@colorado.edu>
2541
2554
2542 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2555 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2543 list of auto-defined aliases.
2556 list of auto-defined aliases.
2544
2557
2545 2004-06-13 Fernando Perez <fperez@colorado.edu>
2558 2004-06-13 Fernando Perez <fperez@colorado.edu>
2546
2559
2547 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2560 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2548 install was really requested (so setup.py can be used for other
2561 install was really requested (so setup.py can be used for other
2549 things under Windows).
2562 things under Windows).
2550
2563
2551 2004-06-10 Fernando Perez <fperez@colorado.edu>
2564 2004-06-10 Fernando Perez <fperez@colorado.edu>
2552
2565
2553 * IPython/Logger.py (Logger.create_log): Manually remove any old
2566 * IPython/Logger.py (Logger.create_log): Manually remove any old
2554 backup, since os.remove may fail under Windows. Fixes bug
2567 backup, since os.remove may fail under Windows. Fixes bug
2555 reported by Thorsten.
2568 reported by Thorsten.
2556
2569
2557 2004-06-09 Fernando Perez <fperez@colorado.edu>
2570 2004-06-09 Fernando Perez <fperez@colorado.edu>
2558
2571
2559 * examples/example-embed.py: fixed all references to %n (replaced
2572 * examples/example-embed.py: fixed all references to %n (replaced
2560 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2573 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2561 for all examples and the manual as well.
2574 for all examples and the manual as well.
2562
2575
2563 2004-06-08 Fernando Perez <fperez@colorado.edu>
2576 2004-06-08 Fernando Perez <fperez@colorado.edu>
2564
2577
2565 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2578 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2566 alignment and color management. All 3 prompt subsystems now
2579 alignment and color management. All 3 prompt subsystems now
2567 inherit from BasePrompt.
2580 inherit from BasePrompt.
2568
2581
2569 * tools/release: updates for windows installer build and tag rpms
2582 * tools/release: updates for windows installer build and tag rpms
2570 with python version (since paths are fixed).
2583 with python version (since paths are fixed).
2571
2584
2572 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2585 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2573 which will become eventually obsolete. Also fixed the default
2586 which will become eventually obsolete. Also fixed the default
2574 prompt_in2 to use \D, so at least new users start with the correct
2587 prompt_in2 to use \D, so at least new users start with the correct
2575 defaults.
2588 defaults.
2576 WARNING: Users with existing ipythonrc files will need to apply
2589 WARNING: Users with existing ipythonrc files will need to apply
2577 this fix manually!
2590 this fix manually!
2578
2591
2579 * setup.py: make windows installer (.exe). This is finally the
2592 * setup.py: make windows installer (.exe). This is finally the
2580 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2593 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2581 which I hadn't included because it required Python 2.3 (or recent
2594 which I hadn't included because it required Python 2.3 (or recent
2582 distutils).
2595 distutils).
2583
2596
2584 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2597 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2585 usage of new '\D' escape.
2598 usage of new '\D' escape.
2586
2599
2587 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2600 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2588 lacks os.getuid())
2601 lacks os.getuid())
2589 (CachedOutput.set_colors): Added the ability to turn coloring
2602 (CachedOutput.set_colors): Added the ability to turn coloring
2590 on/off with @colors even for manually defined prompt colors. It
2603 on/off with @colors even for manually defined prompt colors. It
2591 uses a nasty global, but it works safely and via the generic color
2604 uses a nasty global, but it works safely and via the generic color
2592 handling mechanism.
2605 handling mechanism.
2593 (Prompt2.__init__): Introduced new escape '\D' for continuation
2606 (Prompt2.__init__): Introduced new escape '\D' for continuation
2594 prompts. It represents the counter ('\#') as dots.
2607 prompts. It represents the counter ('\#') as dots.
2595 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2608 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2596 need to update their ipythonrc files and replace '%n' with '\D' in
2609 need to update their ipythonrc files and replace '%n' with '\D' in
2597 their prompt_in2 settings everywhere. Sorry, but there's
2610 their prompt_in2 settings everywhere. Sorry, but there's
2598 otherwise no clean way to get all prompts to properly align. The
2611 otherwise no clean way to get all prompts to properly align. The
2599 ipythonrc shipped with IPython has been updated.
2612 ipythonrc shipped with IPython has been updated.
2600
2613
2601 2004-06-07 Fernando Perez <fperez@colorado.edu>
2614 2004-06-07 Fernando Perez <fperez@colorado.edu>
2602
2615
2603 * setup.py (isfile): Pass local_icons option to latex2html, so the
2616 * setup.py (isfile): Pass local_icons option to latex2html, so the
2604 resulting HTML file is self-contained. Thanks to
2617 resulting HTML file is self-contained. Thanks to
2605 dryice-AT-liu.com.cn for the tip.
2618 dryice-AT-liu.com.cn for the tip.
2606
2619
2607 * pysh.py: I created a new profile 'shell', which implements a
2620 * pysh.py: I created a new profile 'shell', which implements a
2608 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2621 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2609 system shell, nor will it become one anytime soon. It's mainly
2622 system shell, nor will it become one anytime soon. It's mainly
2610 meant to illustrate the use of the new flexible bash-like prompts.
2623 meant to illustrate the use of the new flexible bash-like prompts.
2611 I guess it could be used by hardy souls for true shell management,
2624 I guess it could be used by hardy souls for true shell management,
2612 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2625 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2613 profile. This uses the InterpreterExec extension provided by
2626 profile. This uses the InterpreterExec extension provided by
2614 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2627 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2615
2628
2616 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2629 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2617 auto-align itself with the length of the previous input prompt
2630 auto-align itself with the length of the previous input prompt
2618 (taking into account the invisible color escapes).
2631 (taking into account the invisible color escapes).
2619 (CachedOutput.__init__): Large restructuring of this class. Now
2632 (CachedOutput.__init__): Large restructuring of this class. Now
2620 all three prompts (primary1, primary2, output) are proper objects,
2633 all three prompts (primary1, primary2, output) are proper objects,
2621 managed by the 'parent' CachedOutput class. The code is still a
2634 managed by the 'parent' CachedOutput class. The code is still a
2622 bit hackish (all prompts share state via a pointer to the cache),
2635 bit hackish (all prompts share state via a pointer to the cache),
2623 but it's overall far cleaner than before.
2636 but it's overall far cleaner than before.
2624
2637
2625 * IPython/genutils.py (getoutputerror): modified to add verbose,
2638 * IPython/genutils.py (getoutputerror): modified to add verbose,
2626 debug and header options. This makes the interface of all getout*
2639 debug and header options. This makes the interface of all getout*
2627 functions uniform.
2640 functions uniform.
2628 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2641 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2629
2642
2630 * IPython/Magic.py (Magic.default_option): added a function to
2643 * IPython/Magic.py (Magic.default_option): added a function to
2631 allow registering default options for any magic command. This
2644 allow registering default options for any magic command. This
2632 makes it easy to have profiles which customize the magics globally
2645 makes it easy to have profiles which customize the magics globally
2633 for a certain use. The values set through this function are
2646 for a certain use. The values set through this function are
2634 picked up by the parse_options() method, which all magics should
2647 picked up by the parse_options() method, which all magics should
2635 use to parse their options.
2648 use to parse their options.
2636
2649
2637 * IPython/genutils.py (warn): modified the warnings framework to
2650 * IPython/genutils.py (warn): modified the warnings framework to
2638 use the Term I/O class. I'm trying to slowly unify all of
2651 use the Term I/O class. I'm trying to slowly unify all of
2639 IPython's I/O operations to pass through Term.
2652 IPython's I/O operations to pass through Term.
2640
2653
2641 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2654 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2642 the secondary prompt to correctly match the length of the primary
2655 the secondary prompt to correctly match the length of the primary
2643 one for any prompt. Now multi-line code will properly line up
2656 one for any prompt. Now multi-line code will properly line up
2644 even for path dependent prompts, such as the new ones available
2657 even for path dependent prompts, such as the new ones available
2645 via the prompt_specials.
2658 via the prompt_specials.
2646
2659
2647 2004-06-06 Fernando Perez <fperez@colorado.edu>
2660 2004-06-06 Fernando Perez <fperez@colorado.edu>
2648
2661
2649 * IPython/Prompts.py (prompt_specials): Added the ability to have
2662 * IPython/Prompts.py (prompt_specials): Added the ability to have
2650 bash-like special sequences in the prompts, which get
2663 bash-like special sequences in the prompts, which get
2651 automatically expanded. Things like hostname, current working
2664 automatically expanded. Things like hostname, current working
2652 directory and username are implemented already, but it's easy to
2665 directory and username are implemented already, but it's easy to
2653 add more in the future. Thanks to a patch by W.J. van der Laan
2666 add more in the future. Thanks to a patch by W.J. van der Laan
2654 <gnufnork-AT-hetdigitalegat.nl>
2667 <gnufnork-AT-hetdigitalegat.nl>
2655 (prompt_specials): Added color support for prompt strings, so
2668 (prompt_specials): Added color support for prompt strings, so
2656 users can define arbitrary color setups for their prompts.
2669 users can define arbitrary color setups for their prompts.
2657
2670
2658 2004-06-05 Fernando Perez <fperez@colorado.edu>
2671 2004-06-05 Fernando Perez <fperez@colorado.edu>
2659
2672
2660 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2673 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2661 code to load Gary Bishop's readline and configure it
2674 code to load Gary Bishop's readline and configure it
2662 automatically. Thanks to Gary for help on this.
2675 automatically. Thanks to Gary for help on this.
2663
2676
2664 2004-06-01 Fernando Perez <fperez@colorado.edu>
2677 2004-06-01 Fernando Perez <fperez@colorado.edu>
2665
2678
2666 * IPython/Logger.py (Logger.create_log): fix bug for logging
2679 * IPython/Logger.py (Logger.create_log): fix bug for logging
2667 with no filename (previous fix was incomplete).
2680 with no filename (previous fix was incomplete).
2668
2681
2669 2004-05-25 Fernando Perez <fperez@colorado.edu>
2682 2004-05-25 Fernando Perez <fperez@colorado.edu>
2670
2683
2671 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2684 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2672 parens would get passed to the shell.
2685 parens would get passed to the shell.
2673
2686
2674 2004-05-20 Fernando Perez <fperez@colorado.edu>
2687 2004-05-20 Fernando Perez <fperez@colorado.edu>
2675
2688
2676 * IPython/Magic.py (Magic.magic_prun): changed default profile
2689 * IPython/Magic.py (Magic.magic_prun): changed default profile
2677 sort order to 'time' (the more common profiling need).
2690 sort order to 'time' (the more common profiling need).
2678
2691
2679 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2692 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2680 so that source code shown is guaranteed in sync with the file on
2693 so that source code shown is guaranteed in sync with the file on
2681 disk (also changed in psource). Similar fix to the one for
2694 disk (also changed in psource). Similar fix to the one for
2682 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2695 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2683 <yann.ledu-AT-noos.fr>.
2696 <yann.ledu-AT-noos.fr>.
2684
2697
2685 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2698 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2686 with a single option would not be correctly parsed. Closes
2699 with a single option would not be correctly parsed. Closes
2687 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2700 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2688 introduced in 0.6.0 (on 2004-05-06).
2701 introduced in 0.6.0 (on 2004-05-06).
2689
2702
2690 2004-05-13 *** Released version 0.6.0
2703 2004-05-13 *** Released version 0.6.0
2691
2704
2692 2004-05-13 Fernando Perez <fperez@colorado.edu>
2705 2004-05-13 Fernando Perez <fperez@colorado.edu>
2693
2706
2694 * debian/: Added debian/ directory to CVS, so that debian support
2707 * debian/: Added debian/ directory to CVS, so that debian support
2695 is publicly accessible. The debian package is maintained by Jack
2708 is publicly accessible. The debian package is maintained by Jack
2696 Moffit <jack-AT-xiph.org>.
2709 Moffit <jack-AT-xiph.org>.
2697
2710
2698 * Documentation: included the notes about an ipython-based system
2711 * Documentation: included the notes about an ipython-based system
2699 shell (the hypothetical 'pysh') into the new_design.pdf document,
2712 shell (the hypothetical 'pysh') into the new_design.pdf document,
2700 so that these ideas get distributed to users along with the
2713 so that these ideas get distributed to users along with the
2701 official documentation.
2714 official documentation.
2702
2715
2703 2004-05-10 Fernando Perez <fperez@colorado.edu>
2716 2004-05-10 Fernando Perez <fperez@colorado.edu>
2704
2717
2705 * IPython/Logger.py (Logger.create_log): fix recently introduced
2718 * IPython/Logger.py (Logger.create_log): fix recently introduced
2706 bug (misindented line) where logstart would fail when not given an
2719 bug (misindented line) where logstart would fail when not given an
2707 explicit filename.
2720 explicit filename.
2708
2721
2709 2004-05-09 Fernando Perez <fperez@colorado.edu>
2722 2004-05-09 Fernando Perez <fperez@colorado.edu>
2710
2723
2711 * IPython/Magic.py (Magic.parse_options): skip system call when
2724 * IPython/Magic.py (Magic.parse_options): skip system call when
2712 there are no options to look for. Faster, cleaner for the common
2725 there are no options to look for. Faster, cleaner for the common
2713 case.
2726 case.
2714
2727
2715 * Documentation: many updates to the manual: describing Windows
2728 * Documentation: many updates to the manual: describing Windows
2716 support better, Gnuplot updates, credits, misc small stuff. Also
2729 support better, Gnuplot updates, credits, misc small stuff. Also
2717 updated the new_design doc a bit.
2730 updated the new_design doc a bit.
2718
2731
2719 2004-05-06 *** Released version 0.6.0.rc1
2732 2004-05-06 *** Released version 0.6.0.rc1
2720
2733
2721 2004-05-06 Fernando Perez <fperez@colorado.edu>
2734 2004-05-06 Fernando Perez <fperez@colorado.edu>
2722
2735
2723 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2736 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2724 operations to use the vastly more efficient list/''.join() method.
2737 operations to use the vastly more efficient list/''.join() method.
2725 (FormattedTB.text): Fix
2738 (FormattedTB.text): Fix
2726 http://www.scipy.net/roundup/ipython/issue12 - exception source
2739 http://www.scipy.net/roundup/ipython/issue12 - exception source
2727 extract not updated after reload. Thanks to Mike Salib
2740 extract not updated after reload. Thanks to Mike Salib
2728 <msalib-AT-mit.edu> for pinning the source of the problem.
2741 <msalib-AT-mit.edu> for pinning the source of the problem.
2729 Fortunately, the solution works inside ipython and doesn't require
2742 Fortunately, the solution works inside ipython and doesn't require
2730 any changes to python proper.
2743 any changes to python proper.
2731
2744
2732 * IPython/Magic.py (Magic.parse_options): Improved to process the
2745 * IPython/Magic.py (Magic.parse_options): Improved to process the
2733 argument list as a true shell would (by actually using the
2746 argument list as a true shell would (by actually using the
2734 underlying system shell). This way, all @magics automatically get
2747 underlying system shell). This way, all @magics automatically get
2735 shell expansion for variables. Thanks to a comment by Alex
2748 shell expansion for variables. Thanks to a comment by Alex
2736 Schmolck.
2749 Schmolck.
2737
2750
2738 2004-04-04 Fernando Perez <fperez@colorado.edu>
2751 2004-04-04 Fernando Perez <fperez@colorado.edu>
2739
2752
2740 * IPython/iplib.py (InteractiveShell.interact): Added a special
2753 * IPython/iplib.py (InteractiveShell.interact): Added a special
2741 trap for a debugger quit exception, which is basically impossible
2754 trap for a debugger quit exception, which is basically impossible
2742 to handle by normal mechanisms, given what pdb does to the stack.
2755 to handle by normal mechanisms, given what pdb does to the stack.
2743 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2756 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2744
2757
2745 2004-04-03 Fernando Perez <fperez@colorado.edu>
2758 2004-04-03 Fernando Perez <fperez@colorado.edu>
2746
2759
2747 * IPython/genutils.py (Term): Standardized the names of the Term
2760 * IPython/genutils.py (Term): Standardized the names of the Term
2748 class streams to cin/cout/cerr, following C++ naming conventions
2761 class streams to cin/cout/cerr, following C++ naming conventions
2749 (I can't use in/out/err because 'in' is not a valid attribute
2762 (I can't use in/out/err because 'in' is not a valid attribute
2750 name).
2763 name).
2751
2764
2752 * IPython/iplib.py (InteractiveShell.interact): don't increment
2765 * IPython/iplib.py (InteractiveShell.interact): don't increment
2753 the prompt if there's no user input. By Daniel 'Dang' Griffith
2766 the prompt if there's no user input. By Daniel 'Dang' Griffith
2754 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2767 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2755 Francois Pinard.
2768 Francois Pinard.
2756
2769
2757 2004-04-02 Fernando Perez <fperez@colorado.edu>
2770 2004-04-02 Fernando Perez <fperez@colorado.edu>
2758
2771
2759 * IPython/genutils.py (Stream.__init__): Modified to survive at
2772 * IPython/genutils.py (Stream.__init__): Modified to survive at
2760 least importing in contexts where stdin/out/err aren't true file
2773 least importing in contexts where stdin/out/err aren't true file
2761 objects, such as PyCrust (they lack fileno() and mode). However,
2774 objects, such as PyCrust (they lack fileno() and mode). However,
2762 the recovery facilities which rely on these things existing will
2775 the recovery facilities which rely on these things existing will
2763 not work.
2776 not work.
2764
2777
2765 2004-04-01 Fernando Perez <fperez@colorado.edu>
2778 2004-04-01 Fernando Perez <fperez@colorado.edu>
2766
2779
2767 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2780 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2768 use the new getoutputerror() function, so it properly
2781 use the new getoutputerror() function, so it properly
2769 distinguishes stdout/err.
2782 distinguishes stdout/err.
2770
2783
2771 * IPython/genutils.py (getoutputerror): added a function to
2784 * IPython/genutils.py (getoutputerror): added a function to
2772 capture separately the standard output and error of a command.
2785 capture separately the standard output and error of a command.
2773 After a comment from dang on the mailing lists. This code is
2786 After a comment from dang on the mailing lists. This code is
2774 basically a modified version of commands.getstatusoutput(), from
2787 basically a modified version of commands.getstatusoutput(), from
2775 the standard library.
2788 the standard library.
2776
2789
2777 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2790 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2778 '!!' as a special syntax (shorthand) to access @sx.
2791 '!!' as a special syntax (shorthand) to access @sx.
2779
2792
2780 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2793 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2781 command and return its output as a list split on '\n'.
2794 command and return its output as a list split on '\n'.
2782
2795
2783 2004-03-31 Fernando Perez <fperez@colorado.edu>
2796 2004-03-31 Fernando Perez <fperez@colorado.edu>
2784
2797
2785 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2798 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2786 method to dictionaries used as FakeModule instances if they lack
2799 method to dictionaries used as FakeModule instances if they lack
2787 it. At least pydoc in python2.3 breaks for runtime-defined
2800 it. At least pydoc in python2.3 breaks for runtime-defined
2788 functions without this hack. At some point I need to _really_
2801 functions without this hack. At some point I need to _really_
2789 understand what FakeModule is doing, because it's a gross hack.
2802 understand what FakeModule is doing, because it's a gross hack.
2790 But it solves Arnd's problem for now...
2803 But it solves Arnd's problem for now...
2791
2804
2792 2004-02-27 Fernando Perez <fperez@colorado.edu>
2805 2004-02-27 Fernando Perez <fperez@colorado.edu>
2793
2806
2794 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2807 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2795 mode would behave erratically. Also increased the number of
2808 mode would behave erratically. Also increased the number of
2796 possible logs in rotate mod to 999. Thanks to Rod Holland
2809 possible logs in rotate mod to 999. Thanks to Rod Holland
2797 <rhh@StructureLABS.com> for the report and fixes.
2810 <rhh@StructureLABS.com> for the report and fixes.
2798
2811
2799 2004-02-26 Fernando Perez <fperez@colorado.edu>
2812 2004-02-26 Fernando Perez <fperez@colorado.edu>
2800
2813
2801 * IPython/genutils.py (page): Check that the curses module really
2814 * IPython/genutils.py (page): Check that the curses module really
2802 has the initscr attribute before trying to use it. For some
2815 has the initscr attribute before trying to use it. For some
2803 reason, the Solaris curses module is missing this. I think this
2816 reason, the Solaris curses module is missing this. I think this
2804 should be considered a Solaris python bug, but I'm not sure.
2817 should be considered a Solaris python bug, but I'm not sure.
2805
2818
2806 2004-01-17 Fernando Perez <fperez@colorado.edu>
2819 2004-01-17 Fernando Perez <fperez@colorado.edu>
2807
2820
2808 * IPython/genutils.py (Stream.__init__): Changes to try to make
2821 * IPython/genutils.py (Stream.__init__): Changes to try to make
2809 ipython robust against stdin/out/err being closed by the user.
2822 ipython robust against stdin/out/err being closed by the user.
2810 This is 'user error' (and blocks a normal python session, at least
2823 This is 'user error' (and blocks a normal python session, at least
2811 the stdout case). However, Ipython should be able to survive such
2824 the stdout case). However, Ipython should be able to survive such
2812 instances of abuse as gracefully as possible. To simplify the
2825 instances of abuse as gracefully as possible. To simplify the
2813 coding and maintain compatibility with Gary Bishop's Term
2826 coding and maintain compatibility with Gary Bishop's Term
2814 contributions, I've made use of classmethods for this. I think
2827 contributions, I've made use of classmethods for this. I think
2815 this introduces a dependency on python 2.2.
2828 this introduces a dependency on python 2.2.
2816
2829
2817 2004-01-13 Fernando Perez <fperez@colorado.edu>
2830 2004-01-13 Fernando Perez <fperez@colorado.edu>
2818
2831
2819 * IPython/numutils.py (exp_safe): simplified the code a bit and
2832 * IPython/numutils.py (exp_safe): simplified the code a bit and
2820 removed the need for importing the kinds module altogether.
2833 removed the need for importing the kinds module altogether.
2821
2834
2822 2004-01-06 Fernando Perez <fperez@colorado.edu>
2835 2004-01-06 Fernando Perez <fperez@colorado.edu>
2823
2836
2824 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2837 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2825 a magic function instead, after some community feedback. No
2838 a magic function instead, after some community feedback. No
2826 special syntax will exist for it, but its name is deliberately
2839 special syntax will exist for it, but its name is deliberately
2827 very short.
2840 very short.
2828
2841
2829 2003-12-20 Fernando Perez <fperez@colorado.edu>
2842 2003-12-20 Fernando Perez <fperez@colorado.edu>
2830
2843
2831 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2844 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2832 new functionality, to automagically assign the result of a shell
2845 new functionality, to automagically assign the result of a shell
2833 command to a variable. I'll solicit some community feedback on
2846 command to a variable. I'll solicit some community feedback on
2834 this before making it permanent.
2847 this before making it permanent.
2835
2848
2836 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2849 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2837 requested about callables for which inspect couldn't obtain a
2850 requested about callables for which inspect couldn't obtain a
2838 proper argspec. Thanks to a crash report sent by Etienne
2851 proper argspec. Thanks to a crash report sent by Etienne
2839 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2852 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2840
2853
2841 2003-12-09 Fernando Perez <fperez@colorado.edu>
2854 2003-12-09 Fernando Perez <fperez@colorado.edu>
2842
2855
2843 * IPython/genutils.py (page): patch for the pager to work across
2856 * IPython/genutils.py (page): patch for the pager to work across
2844 various versions of Windows. By Gary Bishop.
2857 various versions of Windows. By Gary Bishop.
2845
2858
2846 2003-12-04 Fernando Perez <fperez@colorado.edu>
2859 2003-12-04 Fernando Perez <fperez@colorado.edu>
2847
2860
2848 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2861 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2849 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2862 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2850 While I tested this and it looks ok, there may still be corner
2863 While I tested this and it looks ok, there may still be corner
2851 cases I've missed.
2864 cases I've missed.
2852
2865
2853 2003-12-01 Fernando Perez <fperez@colorado.edu>
2866 2003-12-01 Fernando Perez <fperez@colorado.edu>
2854
2867
2855 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2868 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2856 where a line like 'p,q=1,2' would fail because the automagic
2869 where a line like 'p,q=1,2' would fail because the automagic
2857 system would be triggered for @p.
2870 system would be triggered for @p.
2858
2871
2859 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2872 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2860 cleanups, code unmodified.
2873 cleanups, code unmodified.
2861
2874
2862 * IPython/genutils.py (Term): added a class for IPython to handle
2875 * IPython/genutils.py (Term): added a class for IPython to handle
2863 output. In most cases it will just be a proxy for stdout/err, but
2876 output. In most cases it will just be a proxy for stdout/err, but
2864 having this allows modifications to be made for some platforms,
2877 having this allows modifications to be made for some platforms,
2865 such as handling color escapes under Windows. All of this code
2878 such as handling color escapes under Windows. All of this code
2866 was contributed by Gary Bishop, with minor modifications by me.
2879 was contributed by Gary Bishop, with minor modifications by me.
2867 The actual changes affect many files.
2880 The actual changes affect many files.
2868
2881
2869 2003-11-30 Fernando Perez <fperez@colorado.edu>
2882 2003-11-30 Fernando Perez <fperez@colorado.edu>
2870
2883
2871 * IPython/iplib.py (file_matches): new completion code, courtesy
2884 * IPython/iplib.py (file_matches): new completion code, courtesy
2872 of Jeff Collins. This enables filename completion again under
2885 of Jeff Collins. This enables filename completion again under
2873 python 2.3, which disabled it at the C level.
2886 python 2.3, which disabled it at the C level.
2874
2887
2875 2003-11-11 Fernando Perez <fperez@colorado.edu>
2888 2003-11-11 Fernando Perez <fperez@colorado.edu>
2876
2889
2877 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2890 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2878 for Numeric.array(map(...)), but often convenient.
2891 for Numeric.array(map(...)), but often convenient.
2879
2892
2880 2003-11-05 Fernando Perez <fperez@colorado.edu>
2893 2003-11-05 Fernando Perez <fperez@colorado.edu>
2881
2894
2882 * IPython/numutils.py (frange): Changed a call from int() to
2895 * IPython/numutils.py (frange): Changed a call from int() to
2883 int(round()) to prevent a problem reported with arange() in the
2896 int(round()) to prevent a problem reported with arange() in the
2884 numpy list.
2897 numpy list.
2885
2898
2886 2003-10-06 Fernando Perez <fperez@colorado.edu>
2899 2003-10-06 Fernando Perez <fperez@colorado.edu>
2887
2900
2888 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2901 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2889 prevent crashes if sys lacks an argv attribute (it happens with
2902 prevent crashes if sys lacks an argv attribute (it happens with
2890 embedded interpreters which build a bare-bones sys module).
2903 embedded interpreters which build a bare-bones sys module).
2891 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2904 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2892
2905
2893 2003-09-24 Fernando Perez <fperez@colorado.edu>
2906 2003-09-24 Fernando Perez <fperez@colorado.edu>
2894
2907
2895 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2908 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2896 to protect against poorly written user objects where __getattr__
2909 to protect against poorly written user objects where __getattr__
2897 raises exceptions other than AttributeError. Thanks to a bug
2910 raises exceptions other than AttributeError. Thanks to a bug
2898 report by Oliver Sander <osander-AT-gmx.de>.
2911 report by Oliver Sander <osander-AT-gmx.de>.
2899
2912
2900 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2913 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2901 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2914 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2902
2915
2903 2003-09-09 Fernando Perez <fperez@colorado.edu>
2916 2003-09-09 Fernando Perez <fperez@colorado.edu>
2904
2917
2905 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2918 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2906 unpacking a list whith a callable as first element would
2919 unpacking a list whith a callable as first element would
2907 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2920 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2908 Collins.
2921 Collins.
2909
2922
2910 2003-08-25 *** Released version 0.5.0
2923 2003-08-25 *** Released version 0.5.0
2911
2924
2912 2003-08-22 Fernando Perez <fperez@colorado.edu>
2925 2003-08-22 Fernando Perez <fperez@colorado.edu>
2913
2926
2914 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2927 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2915 improperly defined user exceptions. Thanks to feedback from Mark
2928 improperly defined user exceptions. Thanks to feedback from Mark
2916 Russell <mrussell-AT-verio.net>.
2929 Russell <mrussell-AT-verio.net>.
2917
2930
2918 2003-08-20 Fernando Perez <fperez@colorado.edu>
2931 2003-08-20 Fernando Perez <fperez@colorado.edu>
2919
2932
2920 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2933 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2921 printing so that it would print multi-line string forms starting
2934 printing so that it would print multi-line string forms starting
2922 with a new line. This way the formatting is better respected for
2935 with a new line. This way the formatting is better respected for
2923 objects which work hard to make nice string forms.
2936 objects which work hard to make nice string forms.
2924
2937
2925 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2938 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2926 autocall would overtake data access for objects with both
2939 autocall would overtake data access for objects with both
2927 __getitem__ and __call__.
2940 __getitem__ and __call__.
2928
2941
2929 2003-08-19 *** Released version 0.5.0-rc1
2942 2003-08-19 *** Released version 0.5.0-rc1
2930
2943
2931 2003-08-19 Fernando Perez <fperez@colorado.edu>
2944 2003-08-19 Fernando Perez <fperez@colorado.edu>
2932
2945
2933 * IPython/deep_reload.py (load_tail): single tiny change here
2946 * IPython/deep_reload.py (load_tail): single tiny change here
2934 seems to fix the long-standing bug of dreload() failing to work
2947 seems to fix the long-standing bug of dreload() failing to work
2935 for dotted names. But this module is pretty tricky, so I may have
2948 for dotted names. But this module is pretty tricky, so I may have
2936 missed some subtlety. Needs more testing!.
2949 missed some subtlety. Needs more testing!.
2937
2950
2938 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2951 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2939 exceptions which have badly implemented __str__ methods.
2952 exceptions which have badly implemented __str__ methods.
2940 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2953 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2941 which I've been getting reports about from Python 2.3 users. I
2954 which I've been getting reports about from Python 2.3 users. I
2942 wish I had a simple test case to reproduce the problem, so I could
2955 wish I had a simple test case to reproduce the problem, so I could
2943 either write a cleaner workaround or file a bug report if
2956 either write a cleaner workaround or file a bug report if
2944 necessary.
2957 necessary.
2945
2958
2946 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2959 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2947 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2960 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2948 a bug report by Tjabo Kloppenburg.
2961 a bug report by Tjabo Kloppenburg.
2949
2962
2950 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2963 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2951 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2964 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2952 seems rather unstable. Thanks to a bug report by Tjabo
2965 seems rather unstable. Thanks to a bug report by Tjabo
2953 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2966 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2954
2967
2955 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2968 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2956 this out soon because of the critical fixes in the inner loop for
2969 this out soon because of the critical fixes in the inner loop for
2957 generators.
2970 generators.
2958
2971
2959 * IPython/Magic.py (Magic.getargspec): removed. This (and
2972 * IPython/Magic.py (Magic.getargspec): removed. This (and
2960 _get_def) have been obsoleted by OInspect for a long time, I
2973 _get_def) have been obsoleted by OInspect for a long time, I
2961 hadn't noticed that they were dead code.
2974 hadn't noticed that they were dead code.
2962 (Magic._ofind): restored _ofind functionality for a few literals
2975 (Magic._ofind): restored _ofind functionality for a few literals
2963 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2976 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2964 for things like "hello".capitalize?, since that would require a
2977 for things like "hello".capitalize?, since that would require a
2965 potentially dangerous eval() again.
2978 potentially dangerous eval() again.
2966
2979
2967 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2980 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2968 logic a bit more to clean up the escapes handling and minimize the
2981 logic a bit more to clean up the escapes handling and minimize the
2969 use of _ofind to only necessary cases. The interactive 'feel' of
2982 use of _ofind to only necessary cases. The interactive 'feel' of
2970 IPython should have improved quite a bit with the changes in
2983 IPython should have improved quite a bit with the changes in
2971 _prefilter and _ofind (besides being far safer than before).
2984 _prefilter and _ofind (besides being far safer than before).
2972
2985
2973 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2986 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2974 obscure, never reported). Edit would fail to find the object to
2987 obscure, never reported). Edit would fail to find the object to
2975 edit under some circumstances.
2988 edit under some circumstances.
2976 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2989 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2977 which were causing double-calling of generators. Those eval calls
2990 which were causing double-calling of generators. Those eval calls
2978 were _very_ dangerous, since code with side effects could be
2991 were _very_ dangerous, since code with side effects could be
2979 triggered. As they say, 'eval is evil'... These were the
2992 triggered. As they say, 'eval is evil'... These were the
2980 nastiest evals in IPython. Besides, _ofind is now far simpler,
2993 nastiest evals in IPython. Besides, _ofind is now far simpler,
2981 and it should also be quite a bit faster. Its use of inspect is
2994 and it should also be quite a bit faster. Its use of inspect is
2982 also safer, so perhaps some of the inspect-related crashes I've
2995 also safer, so perhaps some of the inspect-related crashes I've
2983 seen lately with Python 2.3 might be taken care of. That will
2996 seen lately with Python 2.3 might be taken care of. That will
2984 need more testing.
2997 need more testing.
2985
2998
2986 2003-08-17 Fernando Perez <fperez@colorado.edu>
2999 2003-08-17 Fernando Perez <fperez@colorado.edu>
2987
3000
2988 * IPython/iplib.py (InteractiveShell._prefilter): significant
3001 * IPython/iplib.py (InteractiveShell._prefilter): significant
2989 simplifications to the logic for handling user escapes. Faster
3002 simplifications to the logic for handling user escapes. Faster
2990 and simpler code.
3003 and simpler code.
2991
3004
2992 2003-08-14 Fernando Perez <fperez@colorado.edu>
3005 2003-08-14 Fernando Perez <fperez@colorado.edu>
2993
3006
2994 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3007 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2995 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3008 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2996 but it should be quite a bit faster. And the recursive version
3009 but it should be quite a bit faster. And the recursive version
2997 generated O(log N) intermediate storage for all rank>1 arrays,
3010 generated O(log N) intermediate storage for all rank>1 arrays,
2998 even if they were contiguous.
3011 even if they were contiguous.
2999 (l1norm): Added this function.
3012 (l1norm): Added this function.
3000 (norm): Added this function for arbitrary norms (including
3013 (norm): Added this function for arbitrary norms (including
3001 l-infinity). l1 and l2 are still special cases for convenience
3014 l-infinity). l1 and l2 are still special cases for convenience
3002 and speed.
3015 and speed.
3003
3016
3004 2003-08-03 Fernando Perez <fperez@colorado.edu>
3017 2003-08-03 Fernando Perez <fperez@colorado.edu>
3005
3018
3006 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3019 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3007 exceptions, which now raise PendingDeprecationWarnings in Python
3020 exceptions, which now raise PendingDeprecationWarnings in Python
3008 2.3. There were some in Magic and some in Gnuplot2.
3021 2.3. There were some in Magic and some in Gnuplot2.
3009
3022
3010 2003-06-30 Fernando Perez <fperez@colorado.edu>
3023 2003-06-30 Fernando Perez <fperez@colorado.edu>
3011
3024
3012 * IPython/genutils.py (page): modified to call curses only for
3025 * IPython/genutils.py (page): modified to call curses only for
3013 terminals where TERM=='xterm'. After problems under many other
3026 terminals where TERM=='xterm'. After problems under many other
3014 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3027 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3015
3028
3016 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3029 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3017 would be triggered when readline was absent. This was just an old
3030 would be triggered when readline was absent. This was just an old
3018 debugging statement I'd forgotten to take out.
3031 debugging statement I'd forgotten to take out.
3019
3032
3020 2003-06-20 Fernando Perez <fperez@colorado.edu>
3033 2003-06-20 Fernando Perez <fperez@colorado.edu>
3021
3034
3022 * IPython/genutils.py (clock): modified to return only user time
3035 * IPython/genutils.py (clock): modified to return only user time
3023 (not counting system time), after a discussion on scipy. While
3036 (not counting system time), after a discussion on scipy. While
3024 system time may be a useful quantity occasionally, it may much
3037 system time may be a useful quantity occasionally, it may much
3025 more easily be skewed by occasional swapping or other similar
3038 more easily be skewed by occasional swapping or other similar
3026 activity.
3039 activity.
3027
3040
3028 2003-06-05 Fernando Perez <fperez@colorado.edu>
3041 2003-06-05 Fernando Perez <fperez@colorado.edu>
3029
3042
3030 * IPython/numutils.py (identity): new function, for building
3043 * IPython/numutils.py (identity): new function, for building
3031 arbitrary rank Kronecker deltas (mostly backwards compatible with
3044 arbitrary rank Kronecker deltas (mostly backwards compatible with
3032 Numeric.identity)
3045 Numeric.identity)
3033
3046
3034 2003-06-03 Fernando Perez <fperez@colorado.edu>
3047 2003-06-03 Fernando Perez <fperez@colorado.edu>
3035
3048
3036 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3049 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3037 arguments passed to magics with spaces, to allow trailing '\' to
3050 arguments passed to magics with spaces, to allow trailing '\' to
3038 work normally (mainly for Windows users).
3051 work normally (mainly for Windows users).
3039
3052
3040 2003-05-29 Fernando Perez <fperez@colorado.edu>
3053 2003-05-29 Fernando Perez <fperez@colorado.edu>
3041
3054
3042 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3055 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3043 instead of pydoc.help. This fixes a bizarre behavior where
3056 instead of pydoc.help. This fixes a bizarre behavior where
3044 printing '%s' % locals() would trigger the help system. Now
3057 printing '%s' % locals() would trigger the help system. Now
3045 ipython behaves like normal python does.
3058 ipython behaves like normal python does.
3046
3059
3047 Note that if one does 'from pydoc import help', the bizarre
3060 Note that if one does 'from pydoc import help', the bizarre
3048 behavior returns, but this will also happen in normal python, so
3061 behavior returns, but this will also happen in normal python, so
3049 it's not an ipython bug anymore (it has to do with how pydoc.help
3062 it's not an ipython bug anymore (it has to do with how pydoc.help
3050 is implemented).
3063 is implemented).
3051
3064
3052 2003-05-22 Fernando Perez <fperez@colorado.edu>
3065 2003-05-22 Fernando Perez <fperez@colorado.edu>
3053
3066
3054 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3067 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3055 return [] instead of None when nothing matches, also match to end
3068 return [] instead of None when nothing matches, also match to end
3056 of line. Patch by Gary Bishop.
3069 of line. Patch by Gary Bishop.
3057
3070
3058 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3071 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3059 protection as before, for files passed on the command line. This
3072 protection as before, for files passed on the command line. This
3060 prevents the CrashHandler from kicking in if user files call into
3073 prevents the CrashHandler from kicking in if user files call into
3061 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3074 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3062 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3075 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3063
3076
3064 2003-05-20 *** Released version 0.4.0
3077 2003-05-20 *** Released version 0.4.0
3065
3078
3066 2003-05-20 Fernando Perez <fperez@colorado.edu>
3079 2003-05-20 Fernando Perez <fperez@colorado.edu>
3067
3080
3068 * setup.py: added support for manpages. It's a bit hackish b/c of
3081 * setup.py: added support for manpages. It's a bit hackish b/c of
3069 a bug in the way the bdist_rpm distutils target handles gzipped
3082 a bug in the way the bdist_rpm distutils target handles gzipped
3070 manpages, but it works. After a patch by Jack.
3083 manpages, but it works. After a patch by Jack.
3071
3084
3072 2003-05-19 Fernando Perez <fperez@colorado.edu>
3085 2003-05-19 Fernando Perez <fperez@colorado.edu>
3073
3086
3074 * IPython/numutils.py: added a mockup of the kinds module, since
3087 * IPython/numutils.py: added a mockup of the kinds module, since
3075 it was recently removed from Numeric. This way, numutils will
3088 it was recently removed from Numeric. This way, numutils will
3076 work for all users even if they are missing kinds.
3089 work for all users even if they are missing kinds.
3077
3090
3078 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3091 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3079 failure, which can occur with SWIG-wrapped extensions. After a
3092 failure, which can occur with SWIG-wrapped extensions. After a
3080 crash report from Prabhu.
3093 crash report from Prabhu.
3081
3094
3082 2003-05-16 Fernando Perez <fperez@colorado.edu>
3095 2003-05-16 Fernando Perez <fperez@colorado.edu>
3083
3096
3084 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3097 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3085 protect ipython from user code which may call directly
3098 protect ipython from user code which may call directly
3086 sys.excepthook (this looks like an ipython crash to the user, even
3099 sys.excepthook (this looks like an ipython crash to the user, even
3087 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3100 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3088 This is especially important to help users of WxWindows, but may
3101 This is especially important to help users of WxWindows, but may
3089 also be useful in other cases.
3102 also be useful in other cases.
3090
3103
3091 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3104 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3092 an optional tb_offset to be specified, and to preserve exception
3105 an optional tb_offset to be specified, and to preserve exception
3093 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3106 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3094
3107
3095 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3108 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3096
3109
3097 2003-05-15 Fernando Perez <fperez@colorado.edu>
3110 2003-05-15 Fernando Perez <fperez@colorado.edu>
3098
3111
3099 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3112 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3100 installing for a new user under Windows.
3113 installing for a new user under Windows.
3101
3114
3102 2003-05-12 Fernando Perez <fperez@colorado.edu>
3115 2003-05-12 Fernando Perez <fperez@colorado.edu>
3103
3116
3104 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3117 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3105 handler for Emacs comint-based lines. Currently it doesn't do
3118 handler for Emacs comint-based lines. Currently it doesn't do
3106 much (but importantly, it doesn't update the history cache). In
3119 much (but importantly, it doesn't update the history cache). In
3107 the future it may be expanded if Alex needs more functionality
3120 the future it may be expanded if Alex needs more functionality
3108 there.
3121 there.
3109
3122
3110 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3123 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3111 info to crash reports.
3124 info to crash reports.
3112
3125
3113 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3126 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3114 just like Python's -c. Also fixed crash with invalid -color
3127 just like Python's -c. Also fixed crash with invalid -color
3115 option value at startup. Thanks to Will French
3128 option value at startup. Thanks to Will French
3116 <wfrench-AT-bestweb.net> for the bug report.
3129 <wfrench-AT-bestweb.net> for the bug report.
3117
3130
3118 2003-05-09 Fernando Perez <fperez@colorado.edu>
3131 2003-05-09 Fernando Perez <fperez@colorado.edu>
3119
3132
3120 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3133 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3121 to EvalDict (it's a mapping, after all) and simplified its code
3134 to EvalDict (it's a mapping, after all) and simplified its code
3122 quite a bit, after a nice discussion on c.l.py where Gustavo
3135 quite a bit, after a nice discussion on c.l.py where Gustavo
3123 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3136 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3124
3137
3125 2003-04-30 Fernando Perez <fperez@colorado.edu>
3138 2003-04-30 Fernando Perez <fperez@colorado.edu>
3126
3139
3127 * IPython/genutils.py (timings_out): modified it to reduce its
3140 * IPython/genutils.py (timings_out): modified it to reduce its
3128 overhead in the common reps==1 case.
3141 overhead in the common reps==1 case.
3129
3142
3130 2003-04-29 Fernando Perez <fperez@colorado.edu>
3143 2003-04-29 Fernando Perez <fperez@colorado.edu>
3131
3144
3132 * IPython/genutils.py (timings_out): Modified to use the resource
3145 * IPython/genutils.py (timings_out): Modified to use the resource
3133 module, which avoids the wraparound problems of time.clock().
3146 module, which avoids the wraparound problems of time.clock().
3134
3147
3135 2003-04-17 *** Released version 0.2.15pre4
3148 2003-04-17 *** Released version 0.2.15pre4
3136
3149
3137 2003-04-17 Fernando Perez <fperez@colorado.edu>
3150 2003-04-17 Fernando Perez <fperez@colorado.edu>
3138
3151
3139 * setup.py (scriptfiles): Split windows-specific stuff over to a
3152 * setup.py (scriptfiles): Split windows-specific stuff over to a
3140 separate file, in an attempt to have a Windows GUI installer.
3153 separate file, in an attempt to have a Windows GUI installer.
3141 That didn't work, but part of the groundwork is done.
3154 That didn't work, but part of the groundwork is done.
3142
3155
3143 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3156 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3144 indent/unindent with 4 spaces. Particularly useful in combination
3157 indent/unindent with 4 spaces. Particularly useful in combination
3145 with the new auto-indent option.
3158 with the new auto-indent option.
3146
3159
3147 2003-04-16 Fernando Perez <fperez@colorado.edu>
3160 2003-04-16 Fernando Perez <fperez@colorado.edu>
3148
3161
3149 * IPython/Magic.py: various replacements of self.rc for
3162 * IPython/Magic.py: various replacements of self.rc for
3150 self.shell.rc. A lot more remains to be done to fully disentangle
3163 self.shell.rc. A lot more remains to be done to fully disentangle
3151 this class from the main Shell class.
3164 this class from the main Shell class.
3152
3165
3153 * IPython/GnuplotRuntime.py: added checks for mouse support so
3166 * IPython/GnuplotRuntime.py: added checks for mouse support so
3154 that we don't try to enable it if the current gnuplot doesn't
3167 that we don't try to enable it if the current gnuplot doesn't
3155 really support it. Also added checks so that we don't try to
3168 really support it. Also added checks so that we don't try to
3156 enable persist under Windows (where Gnuplot doesn't recognize the
3169 enable persist under Windows (where Gnuplot doesn't recognize the
3157 option).
3170 option).
3158
3171
3159 * IPython/iplib.py (InteractiveShell.interact): Added optional
3172 * IPython/iplib.py (InteractiveShell.interact): Added optional
3160 auto-indenting code, after a patch by King C. Shu
3173 auto-indenting code, after a patch by King C. Shu
3161 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3174 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3162 get along well with pasting indented code. If I ever figure out
3175 get along well with pasting indented code. If I ever figure out
3163 how to make that part go well, it will become on by default.
3176 how to make that part go well, it will become on by default.
3164
3177
3165 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3178 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3166 crash ipython if there was an unmatched '%' in the user's prompt
3179 crash ipython if there was an unmatched '%' in the user's prompt
3167 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3180 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3168
3181
3169 * IPython/iplib.py (InteractiveShell.interact): removed the
3182 * IPython/iplib.py (InteractiveShell.interact): removed the
3170 ability to ask the user whether he wants to crash or not at the
3183 ability to ask the user whether he wants to crash or not at the
3171 'last line' exception handler. Calling functions at that point
3184 'last line' exception handler. Calling functions at that point
3172 changes the stack, and the error reports would have incorrect
3185 changes the stack, and the error reports would have incorrect
3173 tracebacks.
3186 tracebacks.
3174
3187
3175 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3188 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3176 pass through a peger a pretty-printed form of any object. After a
3189 pass through a peger a pretty-printed form of any object. After a
3177 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3190 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3178
3191
3179 2003-04-14 Fernando Perez <fperez@colorado.edu>
3192 2003-04-14 Fernando Perez <fperez@colorado.edu>
3180
3193
3181 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3194 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3182 all files in ~ would be modified at first install (instead of
3195 all files in ~ would be modified at first install (instead of
3183 ~/.ipython). This could be potentially disastrous, as the
3196 ~/.ipython). This could be potentially disastrous, as the
3184 modification (make line-endings native) could damage binary files.
3197 modification (make line-endings native) could damage binary files.
3185
3198
3186 2003-04-10 Fernando Perez <fperez@colorado.edu>
3199 2003-04-10 Fernando Perez <fperez@colorado.edu>
3187
3200
3188 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3201 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3189 handle only lines which are invalid python. This now means that
3202 handle only lines which are invalid python. This now means that
3190 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3203 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3191 for the bug report.
3204 for the bug report.
3192
3205
3193 2003-04-01 Fernando Perez <fperez@colorado.edu>
3206 2003-04-01 Fernando Perez <fperez@colorado.edu>
3194
3207
3195 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3208 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3196 where failing to set sys.last_traceback would crash pdb.pm().
3209 where failing to set sys.last_traceback would crash pdb.pm().
3197 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3210 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3198 report.
3211 report.
3199
3212
3200 2003-03-25 Fernando Perez <fperez@colorado.edu>
3213 2003-03-25 Fernando Perez <fperez@colorado.edu>
3201
3214
3202 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3215 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3203 before printing it (it had a lot of spurious blank lines at the
3216 before printing it (it had a lot of spurious blank lines at the
3204 end).
3217 end).
3205
3218
3206 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3219 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3207 output would be sent 21 times! Obviously people don't use this
3220 output would be sent 21 times! Obviously people don't use this
3208 too often, or I would have heard about it.
3221 too often, or I would have heard about it.
3209
3222
3210 2003-03-24 Fernando Perez <fperez@colorado.edu>
3223 2003-03-24 Fernando Perez <fperez@colorado.edu>
3211
3224
3212 * setup.py (scriptfiles): renamed the data_files parameter from
3225 * setup.py (scriptfiles): renamed the data_files parameter from
3213 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3226 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3214 for the patch.
3227 for the patch.
3215
3228
3216 2003-03-20 Fernando Perez <fperez@colorado.edu>
3229 2003-03-20 Fernando Perez <fperez@colorado.edu>
3217
3230
3218 * IPython/genutils.py (error): added error() and fatal()
3231 * IPython/genutils.py (error): added error() and fatal()
3219 functions.
3232 functions.
3220
3233
3221 2003-03-18 *** Released version 0.2.15pre3
3234 2003-03-18 *** Released version 0.2.15pre3
3222
3235
3223 2003-03-18 Fernando Perez <fperez@colorado.edu>
3236 2003-03-18 Fernando Perez <fperez@colorado.edu>
3224
3237
3225 * setupext/install_data_ext.py
3238 * setupext/install_data_ext.py
3226 (install_data_ext.initialize_options): Class contributed by Jack
3239 (install_data_ext.initialize_options): Class contributed by Jack
3227 Moffit for fixing the old distutils hack. He is sending this to
3240 Moffit for fixing the old distutils hack. He is sending this to
3228 the distutils folks so in the future we may not need it as a
3241 the distutils folks so in the future we may not need it as a
3229 private fix.
3242 private fix.
3230
3243
3231 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3244 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3232 changes for Debian packaging. See his patch for full details.
3245 changes for Debian packaging. See his patch for full details.
3233 The old distutils hack of making the ipythonrc* files carry a
3246 The old distutils hack of making the ipythonrc* files carry a
3234 bogus .py extension is gone, at last. Examples were moved to a
3247 bogus .py extension is gone, at last. Examples were moved to a
3235 separate subdir under doc/, and the separate executable scripts
3248 separate subdir under doc/, and the separate executable scripts
3236 now live in their own directory. Overall a great cleanup. The
3249 now live in their own directory. Overall a great cleanup. The
3237 manual was updated to use the new files, and setup.py has been
3250 manual was updated to use the new files, and setup.py has been
3238 fixed for this setup.
3251 fixed for this setup.
3239
3252
3240 * IPython/PyColorize.py (Parser.usage): made non-executable and
3253 * IPython/PyColorize.py (Parser.usage): made non-executable and
3241 created a pycolor wrapper around it to be included as a script.
3254 created a pycolor wrapper around it to be included as a script.
3242
3255
3243 2003-03-12 *** Released version 0.2.15pre2
3256 2003-03-12 *** Released version 0.2.15pre2
3244
3257
3245 2003-03-12 Fernando Perez <fperez@colorado.edu>
3258 2003-03-12 Fernando Perez <fperez@colorado.edu>
3246
3259
3247 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3260 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3248 long-standing problem with garbage characters in some terminals.
3261 long-standing problem with garbage characters in some terminals.
3249 The issue was really that the \001 and \002 escapes must _only_ be
3262 The issue was really that the \001 and \002 escapes must _only_ be
3250 passed to input prompts (which call readline), but _never_ to
3263 passed to input prompts (which call readline), but _never_ to
3251 normal text to be printed on screen. I changed ColorANSI to have
3264 normal text to be printed on screen. I changed ColorANSI to have
3252 two classes: TermColors and InputTermColors, each with the
3265 two classes: TermColors and InputTermColors, each with the
3253 appropriate escapes for input prompts or normal text. The code in
3266 appropriate escapes for input prompts or normal text. The code in
3254 Prompts.py got slightly more complicated, but this very old and
3267 Prompts.py got slightly more complicated, but this very old and
3255 annoying bug is finally fixed.
3268 annoying bug is finally fixed.
3256
3269
3257 All the credit for nailing down the real origin of this problem
3270 All the credit for nailing down the real origin of this problem
3258 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3271 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3259 *Many* thanks to him for spending quite a bit of effort on this.
3272 *Many* thanks to him for spending quite a bit of effort on this.
3260
3273
3261 2003-03-05 *** Released version 0.2.15pre1
3274 2003-03-05 *** Released version 0.2.15pre1
3262
3275
3263 2003-03-03 Fernando Perez <fperez@colorado.edu>
3276 2003-03-03 Fernando Perez <fperez@colorado.edu>
3264
3277
3265 * IPython/FakeModule.py: Moved the former _FakeModule to a
3278 * IPython/FakeModule.py: Moved the former _FakeModule to a
3266 separate file, because it's also needed by Magic (to fix a similar
3279 separate file, because it's also needed by Magic (to fix a similar
3267 pickle-related issue in @run).
3280 pickle-related issue in @run).
3268
3281
3269 2003-03-02 Fernando Perez <fperez@colorado.edu>
3282 2003-03-02 Fernando Perez <fperez@colorado.edu>
3270
3283
3271 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3284 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3272 the autocall option at runtime.
3285 the autocall option at runtime.
3273 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3286 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3274 across Magic.py to start separating Magic from InteractiveShell.
3287 across Magic.py to start separating Magic from InteractiveShell.
3275 (Magic._ofind): Fixed to return proper namespace for dotted
3288 (Magic._ofind): Fixed to return proper namespace for dotted
3276 names. Before, a dotted name would always return 'not currently
3289 names. Before, a dotted name would always return 'not currently
3277 defined', because it would find the 'parent'. s.x would be found,
3290 defined', because it would find the 'parent'. s.x would be found,
3278 but since 'x' isn't defined by itself, it would get confused.
3291 but since 'x' isn't defined by itself, it would get confused.
3279 (Magic.magic_run): Fixed pickling problems reported by Ralf
3292 (Magic.magic_run): Fixed pickling problems reported by Ralf
3280 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3293 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3281 that I'd used when Mike Heeter reported similar issues at the
3294 that I'd used when Mike Heeter reported similar issues at the
3282 top-level, but now for @run. It boils down to injecting the
3295 top-level, but now for @run. It boils down to injecting the
3283 namespace where code is being executed with something that looks
3296 namespace where code is being executed with something that looks
3284 enough like a module to fool pickle.dump(). Since a pickle stores
3297 enough like a module to fool pickle.dump(). Since a pickle stores
3285 a named reference to the importing module, we need this for
3298 a named reference to the importing module, we need this for
3286 pickles to save something sensible.
3299 pickles to save something sensible.
3287
3300
3288 * IPython/ipmaker.py (make_IPython): added an autocall option.
3301 * IPython/ipmaker.py (make_IPython): added an autocall option.
3289
3302
3290 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3303 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3291 the auto-eval code. Now autocalling is an option, and the code is
3304 the auto-eval code. Now autocalling is an option, and the code is
3292 also vastly safer. There is no more eval() involved at all.
3305 also vastly safer. There is no more eval() involved at all.
3293
3306
3294 2003-03-01 Fernando Perez <fperez@colorado.edu>
3307 2003-03-01 Fernando Perez <fperez@colorado.edu>
3295
3308
3296 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3309 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3297 dict with named keys instead of a tuple.
3310 dict with named keys instead of a tuple.
3298
3311
3299 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3312 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3300
3313
3301 * setup.py (make_shortcut): Fixed message about directories
3314 * setup.py (make_shortcut): Fixed message about directories
3302 created during Windows installation (the directories were ok, just
3315 created during Windows installation (the directories were ok, just
3303 the printed message was misleading). Thanks to Chris Liechti
3316 the printed message was misleading). Thanks to Chris Liechti
3304 <cliechti-AT-gmx.net> for the heads up.
3317 <cliechti-AT-gmx.net> for the heads up.
3305
3318
3306 2003-02-21 Fernando Perez <fperez@colorado.edu>
3319 2003-02-21 Fernando Perez <fperez@colorado.edu>
3307
3320
3308 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3321 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3309 of ValueError exception when checking for auto-execution. This
3322 of ValueError exception when checking for auto-execution. This
3310 one is raised by things like Numeric arrays arr.flat when the
3323 one is raised by things like Numeric arrays arr.flat when the
3311 array is non-contiguous.
3324 array is non-contiguous.
3312
3325
3313 2003-01-31 Fernando Perez <fperez@colorado.edu>
3326 2003-01-31 Fernando Perez <fperez@colorado.edu>
3314
3327
3315 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3328 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3316 not return any value at all (even though the command would get
3329 not return any value at all (even though the command would get
3317 executed).
3330 executed).
3318 (xsys): Flush stdout right after printing the command to ensure
3331 (xsys): Flush stdout right after printing the command to ensure
3319 proper ordering of commands and command output in the total
3332 proper ordering of commands and command output in the total
3320 output.
3333 output.
3321 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3334 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3322 system/getoutput as defaults. The old ones are kept for
3335 system/getoutput as defaults. The old ones are kept for
3323 compatibility reasons, so no code which uses this library needs
3336 compatibility reasons, so no code which uses this library needs
3324 changing.
3337 changing.
3325
3338
3326 2003-01-27 *** Released version 0.2.14
3339 2003-01-27 *** Released version 0.2.14
3327
3340
3328 2003-01-25 Fernando Perez <fperez@colorado.edu>
3341 2003-01-25 Fernando Perez <fperez@colorado.edu>
3329
3342
3330 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3343 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3331 functions defined in previous edit sessions could not be re-edited
3344 functions defined in previous edit sessions could not be re-edited
3332 (because the temp files were immediately removed). Now temp files
3345 (because the temp files were immediately removed). Now temp files
3333 are removed only at IPython's exit.
3346 are removed only at IPython's exit.
3334 (Magic.magic_run): Improved @run to perform shell-like expansions
3347 (Magic.magic_run): Improved @run to perform shell-like expansions
3335 on its arguments (~users and $VARS). With this, @run becomes more
3348 on its arguments (~users and $VARS). With this, @run becomes more
3336 like a normal command-line.
3349 like a normal command-line.
3337
3350
3338 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3351 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3339 bugs related to embedding and cleaned up that code. A fairly
3352 bugs related to embedding and cleaned up that code. A fairly
3340 important one was the impossibility to access the global namespace
3353 important one was the impossibility to access the global namespace
3341 through the embedded IPython (only local variables were visible).
3354 through the embedded IPython (only local variables were visible).
3342
3355
3343 2003-01-14 Fernando Perez <fperez@colorado.edu>
3356 2003-01-14 Fernando Perez <fperez@colorado.edu>
3344
3357
3345 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3358 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3346 auto-calling to be a bit more conservative. Now it doesn't get
3359 auto-calling to be a bit more conservative. Now it doesn't get
3347 triggered if any of '!=()<>' are in the rest of the input line, to
3360 triggered if any of '!=()<>' are in the rest of the input line, to
3348 allow comparing callables. Thanks to Alex for the heads up.
3361 allow comparing callables. Thanks to Alex for the heads up.
3349
3362
3350 2003-01-07 Fernando Perez <fperez@colorado.edu>
3363 2003-01-07 Fernando Perez <fperez@colorado.edu>
3351
3364
3352 * IPython/genutils.py (page): fixed estimation of the number of
3365 * IPython/genutils.py (page): fixed estimation of the number of
3353 lines in a string to be paged to simply count newlines. This
3366 lines in a string to be paged to simply count newlines. This
3354 prevents over-guessing due to embedded escape sequences. A better
3367 prevents over-guessing due to embedded escape sequences. A better
3355 long-term solution would involve stripping out the control chars
3368 long-term solution would involve stripping out the control chars
3356 for the count, but it's potentially so expensive I just don't
3369 for the count, but it's potentially so expensive I just don't
3357 think it's worth doing.
3370 think it's worth doing.
3358
3371
3359 2002-12-19 *** Released version 0.2.14pre50
3372 2002-12-19 *** Released version 0.2.14pre50
3360
3373
3361 2002-12-19 Fernando Perez <fperez@colorado.edu>
3374 2002-12-19 Fernando Perez <fperez@colorado.edu>
3362
3375
3363 * tools/release (version): Changed release scripts to inform
3376 * tools/release (version): Changed release scripts to inform
3364 Andrea and build a NEWS file with a list of recent changes.
3377 Andrea and build a NEWS file with a list of recent changes.
3365
3378
3366 * IPython/ColorANSI.py (__all__): changed terminal detection
3379 * IPython/ColorANSI.py (__all__): changed terminal detection
3367 code. Seems to work better for xterms without breaking
3380 code. Seems to work better for xterms without breaking
3368 konsole. Will need more testing to determine if WinXP and Mac OSX
3381 konsole. Will need more testing to determine if WinXP and Mac OSX
3369 also work ok.
3382 also work ok.
3370
3383
3371 2002-12-18 *** Released version 0.2.14pre49
3384 2002-12-18 *** Released version 0.2.14pre49
3372
3385
3373 2002-12-18 Fernando Perez <fperez@colorado.edu>
3386 2002-12-18 Fernando Perez <fperez@colorado.edu>
3374
3387
3375 * Docs: added new info about Mac OSX, from Andrea.
3388 * Docs: added new info about Mac OSX, from Andrea.
3376
3389
3377 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3390 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3378 allow direct plotting of python strings whose format is the same
3391 allow direct plotting of python strings whose format is the same
3379 of gnuplot data files.
3392 of gnuplot data files.
3380
3393
3381 2002-12-16 Fernando Perez <fperez@colorado.edu>
3394 2002-12-16 Fernando Perez <fperez@colorado.edu>
3382
3395
3383 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3396 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3384 value of exit question to be acknowledged.
3397 value of exit question to be acknowledged.
3385
3398
3386 2002-12-03 Fernando Perez <fperez@colorado.edu>
3399 2002-12-03 Fernando Perez <fperez@colorado.edu>
3387
3400
3388 * IPython/ipmaker.py: removed generators, which had been added
3401 * IPython/ipmaker.py: removed generators, which had been added
3389 by mistake in an earlier debugging run. This was causing trouble
3402 by mistake in an earlier debugging run. This was causing trouble
3390 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3403 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3391 for pointing this out.
3404 for pointing this out.
3392
3405
3393 2002-11-17 Fernando Perez <fperez@colorado.edu>
3406 2002-11-17 Fernando Perez <fperez@colorado.edu>
3394
3407
3395 * Manual: updated the Gnuplot section.
3408 * Manual: updated the Gnuplot section.
3396
3409
3397 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3410 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3398 a much better split of what goes in Runtime and what goes in
3411 a much better split of what goes in Runtime and what goes in
3399 Interactive.
3412 Interactive.
3400
3413
3401 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3414 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3402 being imported from iplib.
3415 being imported from iplib.
3403
3416
3404 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3417 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3405 for command-passing. Now the global Gnuplot instance is called
3418 for command-passing. Now the global Gnuplot instance is called
3406 'gp' instead of 'g', which was really a far too fragile and
3419 'gp' instead of 'g', which was really a far too fragile and
3407 common name.
3420 common name.
3408
3421
3409 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3422 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3410 bounding boxes generated by Gnuplot for square plots.
3423 bounding boxes generated by Gnuplot for square plots.
3411
3424
3412 * IPython/genutils.py (popkey): new function added. I should
3425 * IPython/genutils.py (popkey): new function added. I should
3413 suggest this on c.l.py as a dict method, it seems useful.
3426 suggest this on c.l.py as a dict method, it seems useful.
3414
3427
3415 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3428 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3416 to transparently handle PostScript generation. MUCH better than
3429 to transparently handle PostScript generation. MUCH better than
3417 the previous plot_eps/replot_eps (which I removed now). The code
3430 the previous plot_eps/replot_eps (which I removed now). The code
3418 is also fairly clean and well documented now (including
3431 is also fairly clean and well documented now (including
3419 docstrings).
3432 docstrings).
3420
3433
3421 2002-11-13 Fernando Perez <fperez@colorado.edu>
3434 2002-11-13 Fernando Perez <fperez@colorado.edu>
3422
3435
3423 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3436 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3424 (inconsistent with options).
3437 (inconsistent with options).
3425
3438
3426 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3439 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3427 manually disabled, I don't know why. Fixed it.
3440 manually disabled, I don't know why. Fixed it.
3428 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3441 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3429 eps output.
3442 eps output.
3430
3443
3431 2002-11-12 Fernando Perez <fperez@colorado.edu>
3444 2002-11-12 Fernando Perez <fperez@colorado.edu>
3432
3445
3433 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3446 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3434 don't propagate up to caller. Fixes crash reported by François
3447 don't propagate up to caller. Fixes crash reported by François
3435 Pinard.
3448 Pinard.
3436
3449
3437 2002-11-09 Fernando Perez <fperez@colorado.edu>
3450 2002-11-09 Fernando Perez <fperez@colorado.edu>
3438
3451
3439 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3452 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3440 history file for new users.
3453 history file for new users.
3441 (make_IPython): fixed bug where initial install would leave the
3454 (make_IPython): fixed bug where initial install would leave the
3442 user running in the .ipython dir.
3455 user running in the .ipython dir.
3443 (make_IPython): fixed bug where config dir .ipython would be
3456 (make_IPython): fixed bug where config dir .ipython would be
3444 created regardless of the given -ipythondir option. Thanks to Cory
3457 created regardless of the given -ipythondir option. Thanks to Cory
3445 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3458 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3446
3459
3447 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3460 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3448 type confirmations. Will need to use it in all of IPython's code
3461 type confirmations. Will need to use it in all of IPython's code
3449 consistently.
3462 consistently.
3450
3463
3451 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3464 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3452 context to print 31 lines instead of the default 5. This will make
3465 context to print 31 lines instead of the default 5. This will make
3453 the crash reports extremely detailed in case the problem is in
3466 the crash reports extremely detailed in case the problem is in
3454 libraries I don't have access to.
3467 libraries I don't have access to.
3455
3468
3456 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3469 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3457 line of defense' code to still crash, but giving users fair
3470 line of defense' code to still crash, but giving users fair
3458 warning. I don't want internal errors to go unreported: if there's
3471 warning. I don't want internal errors to go unreported: if there's
3459 an internal problem, IPython should crash and generate a full
3472 an internal problem, IPython should crash and generate a full
3460 report.
3473 report.
3461
3474
3462 2002-11-08 Fernando Perez <fperez@colorado.edu>
3475 2002-11-08 Fernando Perez <fperez@colorado.edu>
3463
3476
3464 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3477 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3465 otherwise uncaught exceptions which can appear if people set
3478 otherwise uncaught exceptions which can appear if people set
3466 sys.stdout to something badly broken. Thanks to a crash report
3479 sys.stdout to something badly broken. Thanks to a crash report
3467 from henni-AT-mail.brainbot.com.
3480 from henni-AT-mail.brainbot.com.
3468
3481
3469 2002-11-04 Fernando Perez <fperez@colorado.edu>
3482 2002-11-04 Fernando Perez <fperez@colorado.edu>
3470
3483
3471 * IPython/iplib.py (InteractiveShell.interact): added
3484 * IPython/iplib.py (InteractiveShell.interact): added
3472 __IPYTHON__active to the builtins. It's a flag which goes on when
3485 __IPYTHON__active to the builtins. It's a flag which goes on when
3473 the interaction starts and goes off again when it stops. This
3486 the interaction starts and goes off again when it stops. This
3474 allows embedding code to detect being inside IPython. Before this
3487 allows embedding code to detect being inside IPython. Before this
3475 was done via __IPYTHON__, but that only shows that an IPython
3488 was done via __IPYTHON__, but that only shows that an IPython
3476 instance has been created.
3489 instance has been created.
3477
3490
3478 * IPython/Magic.py (Magic.magic_env): I realized that in a
3491 * IPython/Magic.py (Magic.magic_env): I realized that in a
3479 UserDict, instance.data holds the data as a normal dict. So I
3492 UserDict, instance.data holds the data as a normal dict. So I
3480 modified @env to return os.environ.data instead of rebuilding a
3493 modified @env to return os.environ.data instead of rebuilding a
3481 dict by hand.
3494 dict by hand.
3482
3495
3483 2002-11-02 Fernando Perez <fperez@colorado.edu>
3496 2002-11-02 Fernando Perez <fperez@colorado.edu>
3484
3497
3485 * IPython/genutils.py (warn): changed so that level 1 prints no
3498 * IPython/genutils.py (warn): changed so that level 1 prints no
3486 header. Level 2 is now the default (with 'WARNING' header, as
3499 header. Level 2 is now the default (with 'WARNING' header, as
3487 before). I think I tracked all places where changes were needed in
3500 before). I think I tracked all places where changes were needed in
3488 IPython, but outside code using the old level numbering may have
3501 IPython, but outside code using the old level numbering may have
3489 broken.
3502 broken.
3490
3503
3491 * IPython/iplib.py (InteractiveShell.runcode): added this to
3504 * IPython/iplib.py (InteractiveShell.runcode): added this to
3492 handle the tracebacks in SystemExit traps correctly. The previous
3505 handle the tracebacks in SystemExit traps correctly. The previous
3493 code (through interact) was printing more of the stack than
3506 code (through interact) was printing more of the stack than
3494 necessary, showing IPython internal code to the user.
3507 necessary, showing IPython internal code to the user.
3495
3508
3496 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3509 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3497 default. Now that the default at the confirmation prompt is yes,
3510 default. Now that the default at the confirmation prompt is yes,
3498 it's not so intrusive. François' argument that ipython sessions
3511 it's not so intrusive. François' argument that ipython sessions
3499 tend to be complex enough not to lose them from an accidental C-d,
3512 tend to be complex enough not to lose them from an accidental C-d,
3500 is a valid one.
3513 is a valid one.
3501
3514
3502 * IPython/iplib.py (InteractiveShell.interact): added a
3515 * IPython/iplib.py (InteractiveShell.interact): added a
3503 showtraceback() call to the SystemExit trap, and modified the exit
3516 showtraceback() call to the SystemExit trap, and modified the exit
3504 confirmation to have yes as the default.
3517 confirmation to have yes as the default.
3505
3518
3506 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3519 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3507 this file. It's been gone from the code for a long time, this was
3520 this file. It's been gone from the code for a long time, this was
3508 simply leftover junk.
3521 simply leftover junk.
3509
3522
3510 2002-11-01 Fernando Perez <fperez@colorado.edu>
3523 2002-11-01 Fernando Perez <fperez@colorado.edu>
3511
3524
3512 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3525 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3513 added. If set, IPython now traps EOF and asks for
3526 added. If set, IPython now traps EOF and asks for
3514 confirmation. After a request by François Pinard.
3527 confirmation. After a request by François Pinard.
3515
3528
3516 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3529 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3517 of @abort, and with a new (better) mechanism for handling the
3530 of @abort, and with a new (better) mechanism for handling the
3518 exceptions.
3531 exceptions.
3519
3532
3520 2002-10-27 Fernando Perez <fperez@colorado.edu>
3533 2002-10-27 Fernando Perez <fperez@colorado.edu>
3521
3534
3522 * IPython/usage.py (__doc__): updated the --help information and
3535 * IPython/usage.py (__doc__): updated the --help information and
3523 the ipythonrc file to indicate that -log generates
3536 the ipythonrc file to indicate that -log generates
3524 ./ipython.log. Also fixed the corresponding info in @logstart.
3537 ./ipython.log. Also fixed the corresponding info in @logstart.
3525 This and several other fixes in the manuals thanks to reports by
3538 This and several other fixes in the manuals thanks to reports by
3526 François Pinard <pinard-AT-iro.umontreal.ca>.
3539 François Pinard <pinard-AT-iro.umontreal.ca>.
3527
3540
3528 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3541 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3529 refer to @logstart (instead of @log, which doesn't exist).
3542 refer to @logstart (instead of @log, which doesn't exist).
3530
3543
3531 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3544 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3532 AttributeError crash. Thanks to Christopher Armstrong
3545 AttributeError crash. Thanks to Christopher Armstrong
3533 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3546 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3534 introduced recently (in 0.2.14pre37) with the fix to the eval
3547 introduced recently (in 0.2.14pre37) with the fix to the eval
3535 problem mentioned below.
3548 problem mentioned below.
3536
3549
3537 2002-10-17 Fernando Perez <fperez@colorado.edu>
3550 2002-10-17 Fernando Perez <fperez@colorado.edu>
3538
3551
3539 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3552 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3540 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3553 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3541
3554
3542 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3555 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3543 this function to fix a problem reported by Alex Schmolck. He saw
3556 this function to fix a problem reported by Alex Schmolck. He saw
3544 it with list comprehensions and generators, which were getting
3557 it with list comprehensions and generators, which were getting
3545 called twice. The real problem was an 'eval' call in testing for
3558 called twice. The real problem was an 'eval' call in testing for
3546 automagic which was evaluating the input line silently.
3559 automagic which was evaluating the input line silently.
3547
3560
3548 This is a potentially very nasty bug, if the input has side
3561 This is a potentially very nasty bug, if the input has side
3549 effects which must not be repeated. The code is much cleaner now,
3562 effects which must not be repeated. The code is much cleaner now,
3550 without any blanket 'except' left and with a regexp test for
3563 without any blanket 'except' left and with a regexp test for
3551 actual function names.
3564 actual function names.
3552
3565
3553 But an eval remains, which I'm not fully comfortable with. I just
3566 But an eval remains, which I'm not fully comfortable with. I just
3554 don't know how to find out if an expression could be a callable in
3567 don't know how to find out if an expression could be a callable in
3555 the user's namespace without doing an eval on the string. However
3568 the user's namespace without doing an eval on the string. However
3556 that string is now much more strictly checked so that no code
3569 that string is now much more strictly checked so that no code
3557 slips by, so the eval should only happen for things that can
3570 slips by, so the eval should only happen for things that can
3558 really be only function/method names.
3571 really be only function/method names.
3559
3572
3560 2002-10-15 Fernando Perez <fperez@colorado.edu>
3573 2002-10-15 Fernando Perez <fperez@colorado.edu>
3561
3574
3562 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3575 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3563 OSX information to main manual, removed README_Mac_OSX file from
3576 OSX information to main manual, removed README_Mac_OSX file from
3564 distribution. Also updated credits for recent additions.
3577 distribution. Also updated credits for recent additions.
3565
3578
3566 2002-10-10 Fernando Perez <fperez@colorado.edu>
3579 2002-10-10 Fernando Perez <fperez@colorado.edu>
3567
3580
3568 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3581 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3569 terminal-related issues. Many thanks to Andrea Riciputi
3582 terminal-related issues. Many thanks to Andrea Riciputi
3570 <andrea.riciputi-AT-libero.it> for writing it.
3583 <andrea.riciputi-AT-libero.it> for writing it.
3571
3584
3572 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3585 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3573 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3586 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3574
3587
3575 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3588 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3576 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3589 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3577 <syver-en-AT-online.no> who both submitted patches for this problem.
3590 <syver-en-AT-online.no> who both submitted patches for this problem.
3578
3591
3579 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3592 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3580 global embedding to make sure that things don't overwrite user
3593 global embedding to make sure that things don't overwrite user
3581 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3594 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3582
3595
3583 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3596 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3584 compatibility. Thanks to Hayden Callow
3597 compatibility. Thanks to Hayden Callow
3585 <h.callow-AT-elec.canterbury.ac.nz>
3598 <h.callow-AT-elec.canterbury.ac.nz>
3586
3599
3587 2002-10-04 Fernando Perez <fperez@colorado.edu>
3600 2002-10-04 Fernando Perez <fperez@colorado.edu>
3588
3601
3589 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3602 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3590 Gnuplot.File objects.
3603 Gnuplot.File objects.
3591
3604
3592 2002-07-23 Fernando Perez <fperez@colorado.edu>
3605 2002-07-23 Fernando Perez <fperez@colorado.edu>
3593
3606
3594 * IPython/genutils.py (timing): Added timings() and timing() for
3607 * IPython/genutils.py (timing): Added timings() and timing() for
3595 quick access to the most commonly needed data, the execution
3608 quick access to the most commonly needed data, the execution
3596 times. Old timing() renamed to timings_out().
3609 times. Old timing() renamed to timings_out().
3597
3610
3598 2002-07-18 Fernando Perez <fperez@colorado.edu>
3611 2002-07-18 Fernando Perez <fperez@colorado.edu>
3599
3612
3600 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3613 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3601 bug with nested instances disrupting the parent's tab completion.
3614 bug with nested instances disrupting the parent's tab completion.
3602
3615
3603 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3616 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3604 all_completions code to begin the emacs integration.
3617 all_completions code to begin the emacs integration.
3605
3618
3606 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3619 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3607 argument to allow titling individual arrays when plotting.
3620 argument to allow titling individual arrays when plotting.
3608
3621
3609 2002-07-15 Fernando Perez <fperez@colorado.edu>
3622 2002-07-15 Fernando Perez <fperez@colorado.edu>
3610
3623
3611 * setup.py (make_shortcut): changed to retrieve the value of
3624 * setup.py (make_shortcut): changed to retrieve the value of
3612 'Program Files' directory from the registry (this value changes in
3625 'Program Files' directory from the registry (this value changes in
3613 non-english versions of Windows). Thanks to Thomas Fanslau
3626 non-english versions of Windows). Thanks to Thomas Fanslau
3614 <tfanslau-AT-gmx.de> for the report.
3627 <tfanslau-AT-gmx.de> for the report.
3615
3628
3616 2002-07-10 Fernando Perez <fperez@colorado.edu>
3629 2002-07-10 Fernando Perez <fperez@colorado.edu>
3617
3630
3618 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3631 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3619 a bug in pdb, which crashes if a line with only whitespace is
3632 a bug in pdb, which crashes if a line with only whitespace is
3620 entered. Bug report submitted to sourceforge.
3633 entered. Bug report submitted to sourceforge.
3621
3634
3622 2002-07-09 Fernando Perez <fperez@colorado.edu>
3635 2002-07-09 Fernando Perez <fperez@colorado.edu>
3623
3636
3624 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3637 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3625 reporting exceptions (it's a bug in inspect.py, I just set a
3638 reporting exceptions (it's a bug in inspect.py, I just set a
3626 workaround).
3639 workaround).
3627
3640
3628 2002-07-08 Fernando Perez <fperez@colorado.edu>
3641 2002-07-08 Fernando Perez <fperez@colorado.edu>
3629
3642
3630 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3643 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3631 __IPYTHON__ in __builtins__ to show up in user_ns.
3644 __IPYTHON__ in __builtins__ to show up in user_ns.
3632
3645
3633 2002-07-03 Fernando Perez <fperez@colorado.edu>
3646 2002-07-03 Fernando Perez <fperez@colorado.edu>
3634
3647
3635 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3648 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3636 name from @gp_set_instance to @gp_set_default.
3649 name from @gp_set_instance to @gp_set_default.
3637
3650
3638 * IPython/ipmaker.py (make_IPython): default editor value set to
3651 * IPython/ipmaker.py (make_IPython): default editor value set to
3639 '0' (a string), to match the rc file. Otherwise will crash when
3652 '0' (a string), to match the rc file. Otherwise will crash when
3640 .strip() is called on it.
3653 .strip() is called on it.
3641
3654
3642
3655
3643 2002-06-28 Fernando Perez <fperez@colorado.edu>
3656 2002-06-28 Fernando Perez <fperez@colorado.edu>
3644
3657
3645 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3658 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3646 of files in current directory when a file is executed via
3659 of files in current directory when a file is executed via
3647 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3660 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3648
3661
3649 * setup.py (manfiles): fix for rpm builds, submitted by RA
3662 * setup.py (manfiles): fix for rpm builds, submitted by RA
3650 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3663 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3651
3664
3652 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3665 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3653 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3666 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3654 string!). A. Schmolck caught this one.
3667 string!). A. Schmolck caught this one.
3655
3668
3656 2002-06-27 Fernando Perez <fperez@colorado.edu>
3669 2002-06-27 Fernando Perez <fperez@colorado.edu>
3657
3670
3658 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3671 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3659 defined files at the cmd line. __name__ wasn't being set to
3672 defined files at the cmd line. __name__ wasn't being set to
3660 __main__.
3673 __main__.
3661
3674
3662 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3675 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3663 regular lists and tuples besides Numeric arrays.
3676 regular lists and tuples besides Numeric arrays.
3664
3677
3665 * IPython/Prompts.py (CachedOutput.__call__): Added output
3678 * IPython/Prompts.py (CachedOutput.__call__): Added output
3666 supression for input ending with ';'. Similar to Mathematica and
3679 supression for input ending with ';'. Similar to Mathematica and
3667 Matlab. The _* vars and Out[] list are still updated, just like
3680 Matlab. The _* vars and Out[] list are still updated, just like
3668 Mathematica behaves.
3681 Mathematica behaves.
3669
3682
3670 2002-06-25 Fernando Perez <fperez@colorado.edu>
3683 2002-06-25 Fernando Perez <fperez@colorado.edu>
3671
3684
3672 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3685 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3673 .ini extensions for profiels under Windows.
3686 .ini extensions for profiels under Windows.
3674
3687
3675 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3688 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3676 string form. Fix contributed by Alexander Schmolck
3689 string form. Fix contributed by Alexander Schmolck
3677 <a.schmolck-AT-gmx.net>
3690 <a.schmolck-AT-gmx.net>
3678
3691
3679 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3692 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3680 pre-configured Gnuplot instance.
3693 pre-configured Gnuplot instance.
3681
3694
3682 2002-06-21 Fernando Perez <fperez@colorado.edu>
3695 2002-06-21 Fernando Perez <fperez@colorado.edu>
3683
3696
3684 * IPython/numutils.py (exp_safe): new function, works around the
3697 * IPython/numutils.py (exp_safe): new function, works around the
3685 underflow problems in Numeric.
3698 underflow problems in Numeric.
3686 (log2): New fn. Safe log in base 2: returns exact integer answer
3699 (log2): New fn. Safe log in base 2: returns exact integer answer
3687 for exact integer powers of 2.
3700 for exact integer powers of 2.
3688
3701
3689 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3702 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3690 properly.
3703 properly.
3691
3704
3692 2002-06-20 Fernando Perez <fperez@colorado.edu>
3705 2002-06-20 Fernando Perez <fperez@colorado.edu>
3693
3706
3694 * IPython/genutils.py (timing): new function like
3707 * IPython/genutils.py (timing): new function like
3695 Mathematica's. Similar to time_test, but returns more info.
3708 Mathematica's. Similar to time_test, but returns more info.
3696
3709
3697 2002-06-18 Fernando Perez <fperez@colorado.edu>
3710 2002-06-18 Fernando Perez <fperez@colorado.edu>
3698
3711
3699 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3712 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3700 according to Mike Heeter's suggestions.
3713 according to Mike Heeter's suggestions.
3701
3714
3702 2002-06-16 Fernando Perez <fperez@colorado.edu>
3715 2002-06-16 Fernando Perez <fperez@colorado.edu>
3703
3716
3704 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3717 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3705 system. GnuplotMagic is gone as a user-directory option. New files
3718 system. GnuplotMagic is gone as a user-directory option. New files
3706 make it easier to use all the gnuplot stuff both from external
3719 make it easier to use all the gnuplot stuff both from external
3707 programs as well as from IPython. Had to rewrite part of
3720 programs as well as from IPython. Had to rewrite part of
3708 hardcopy() b/c of a strange bug: often the ps files simply don't
3721 hardcopy() b/c of a strange bug: often the ps files simply don't
3709 get created, and require a repeat of the command (often several
3722 get created, and require a repeat of the command (often several
3710 times).
3723 times).
3711
3724
3712 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3725 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3713 resolve output channel at call time, so that if sys.stderr has
3726 resolve output channel at call time, so that if sys.stderr has
3714 been redirected by user this gets honored.
3727 been redirected by user this gets honored.
3715
3728
3716 2002-06-13 Fernando Perez <fperez@colorado.edu>
3729 2002-06-13 Fernando Perez <fperez@colorado.edu>
3717
3730
3718 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3731 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3719 IPShell. Kept a copy with the old names to avoid breaking people's
3732 IPShell. Kept a copy with the old names to avoid breaking people's
3720 embedded code.
3733 embedded code.
3721
3734
3722 * IPython/ipython: simplified it to the bare minimum after
3735 * IPython/ipython: simplified it to the bare minimum after
3723 Holger's suggestions. Added info about how to use it in
3736 Holger's suggestions. Added info about how to use it in
3724 PYTHONSTARTUP.
3737 PYTHONSTARTUP.
3725
3738
3726 * IPython/Shell.py (IPythonShell): changed the options passing
3739 * IPython/Shell.py (IPythonShell): changed the options passing
3727 from a string with funky %s replacements to a straight list. Maybe
3740 from a string with funky %s replacements to a straight list. Maybe
3728 a bit more typing, but it follows sys.argv conventions, so there's
3741 a bit more typing, but it follows sys.argv conventions, so there's
3729 less special-casing to remember.
3742 less special-casing to remember.
3730
3743
3731 2002-06-12 Fernando Perez <fperez@colorado.edu>
3744 2002-06-12 Fernando Perez <fperez@colorado.edu>
3732
3745
3733 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3746 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3734 command. Thanks to a suggestion by Mike Heeter.
3747 command. Thanks to a suggestion by Mike Heeter.
3735 (Magic.magic_pfile): added behavior to look at filenames if given
3748 (Magic.magic_pfile): added behavior to look at filenames if given
3736 arg is not a defined object.
3749 arg is not a defined object.
3737 (Magic.magic_save): New @save function to save code snippets. Also
3750 (Magic.magic_save): New @save function to save code snippets. Also
3738 a Mike Heeter idea.
3751 a Mike Heeter idea.
3739
3752
3740 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3753 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3741 plot() and replot(). Much more convenient now, especially for
3754 plot() and replot(). Much more convenient now, especially for
3742 interactive use.
3755 interactive use.
3743
3756
3744 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3757 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3745 filenames.
3758 filenames.
3746
3759
3747 2002-06-02 Fernando Perez <fperez@colorado.edu>
3760 2002-06-02 Fernando Perez <fperez@colorado.edu>
3748
3761
3749 * IPython/Struct.py (Struct.__init__): modified to admit
3762 * IPython/Struct.py (Struct.__init__): modified to admit
3750 initialization via another struct.
3763 initialization via another struct.
3751
3764
3752 * IPython/genutils.py (SystemExec.__init__): New stateful
3765 * IPython/genutils.py (SystemExec.__init__): New stateful
3753 interface to xsys and bq. Useful for writing system scripts.
3766 interface to xsys and bq. Useful for writing system scripts.
3754
3767
3755 2002-05-30 Fernando Perez <fperez@colorado.edu>
3768 2002-05-30 Fernando Perez <fperez@colorado.edu>
3756
3769
3757 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3770 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3758 documents. This will make the user download smaller (it's getting
3771 documents. This will make the user download smaller (it's getting
3759 too big).
3772 too big).
3760
3773
3761 2002-05-29 Fernando Perez <fperez@colorado.edu>
3774 2002-05-29 Fernando Perez <fperez@colorado.edu>
3762
3775
3763 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3776 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3764 fix problems with shelve and pickle. Seems to work, but I don't
3777 fix problems with shelve and pickle. Seems to work, but I don't
3765 know if corner cases break it. Thanks to Mike Heeter
3778 know if corner cases break it. Thanks to Mike Heeter
3766 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3779 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3767
3780
3768 2002-05-24 Fernando Perez <fperez@colorado.edu>
3781 2002-05-24 Fernando Perez <fperez@colorado.edu>
3769
3782
3770 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3783 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3771 macros having broken.
3784 macros having broken.
3772
3785
3773 2002-05-21 Fernando Perez <fperez@colorado.edu>
3786 2002-05-21 Fernando Perez <fperez@colorado.edu>
3774
3787
3775 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3788 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3776 introduced logging bug: all history before logging started was
3789 introduced logging bug: all history before logging started was
3777 being written one character per line! This came from the redesign
3790 being written one character per line! This came from the redesign
3778 of the input history as a special list which slices to strings,
3791 of the input history as a special list which slices to strings,
3779 not to lists.
3792 not to lists.
3780
3793
3781 2002-05-20 Fernando Perez <fperez@colorado.edu>
3794 2002-05-20 Fernando Perez <fperez@colorado.edu>
3782
3795
3783 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3796 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3784 be an attribute of all classes in this module. The design of these
3797 be an attribute of all classes in this module. The design of these
3785 classes needs some serious overhauling.
3798 classes needs some serious overhauling.
3786
3799
3787 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3800 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3788 which was ignoring '_' in option names.
3801 which was ignoring '_' in option names.
3789
3802
3790 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3803 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3791 'Verbose_novars' to 'Context' and made it the new default. It's a
3804 'Verbose_novars' to 'Context' and made it the new default. It's a
3792 bit more readable and also safer than verbose.
3805 bit more readable and also safer than verbose.
3793
3806
3794 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3807 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3795 triple-quoted strings.
3808 triple-quoted strings.
3796
3809
3797 * IPython/OInspect.py (__all__): new module exposing the object
3810 * IPython/OInspect.py (__all__): new module exposing the object
3798 introspection facilities. Now the corresponding magics are dummy
3811 introspection facilities. Now the corresponding magics are dummy
3799 wrappers around this. Having this module will make it much easier
3812 wrappers around this. Having this module will make it much easier
3800 to put these functions into our modified pdb.
3813 to put these functions into our modified pdb.
3801 This new object inspector system uses the new colorizing module,
3814 This new object inspector system uses the new colorizing module,
3802 so source code and other things are nicely syntax highlighted.
3815 so source code and other things are nicely syntax highlighted.
3803
3816
3804 2002-05-18 Fernando Perez <fperez@colorado.edu>
3817 2002-05-18 Fernando Perez <fperez@colorado.edu>
3805
3818
3806 * IPython/ColorANSI.py: Split the coloring tools into a separate
3819 * IPython/ColorANSI.py: Split the coloring tools into a separate
3807 module so I can use them in other code easier (they were part of
3820 module so I can use them in other code easier (they were part of
3808 ultraTB).
3821 ultraTB).
3809
3822
3810 2002-05-17 Fernando Perez <fperez@colorado.edu>
3823 2002-05-17 Fernando Perez <fperez@colorado.edu>
3811
3824
3812 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3825 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3813 fixed it to set the global 'g' also to the called instance, as
3826 fixed it to set the global 'g' also to the called instance, as
3814 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3827 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3815 user's 'g' variables).
3828 user's 'g' variables).
3816
3829
3817 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3830 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3818 global variables (aliases to _ih,_oh) so that users which expect
3831 global variables (aliases to _ih,_oh) so that users which expect
3819 In[5] or Out[7] to work aren't unpleasantly surprised.
3832 In[5] or Out[7] to work aren't unpleasantly surprised.
3820 (InputList.__getslice__): new class to allow executing slices of
3833 (InputList.__getslice__): new class to allow executing slices of
3821 input history directly. Very simple class, complements the use of
3834 input history directly. Very simple class, complements the use of
3822 macros.
3835 macros.
3823
3836
3824 2002-05-16 Fernando Perez <fperez@colorado.edu>
3837 2002-05-16 Fernando Perez <fperez@colorado.edu>
3825
3838
3826 * setup.py (docdirbase): make doc directory be just doc/IPython
3839 * setup.py (docdirbase): make doc directory be just doc/IPython
3827 without version numbers, it will reduce clutter for users.
3840 without version numbers, it will reduce clutter for users.
3828
3841
3829 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3842 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3830 execfile call to prevent possible memory leak. See for details:
3843 execfile call to prevent possible memory leak. See for details:
3831 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3844 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3832
3845
3833 2002-05-15 Fernando Perez <fperez@colorado.edu>
3846 2002-05-15 Fernando Perez <fperez@colorado.edu>
3834
3847
3835 * IPython/Magic.py (Magic.magic_psource): made the object
3848 * IPython/Magic.py (Magic.magic_psource): made the object
3836 introspection names be more standard: pdoc, pdef, pfile and
3849 introspection names be more standard: pdoc, pdef, pfile and
3837 psource. They all print/page their output, and it makes
3850 psource. They all print/page their output, and it makes
3838 remembering them easier. Kept old names for compatibility as
3851 remembering them easier. Kept old names for compatibility as
3839 aliases.
3852 aliases.
3840
3853
3841 2002-05-14 Fernando Perez <fperez@colorado.edu>
3854 2002-05-14 Fernando Perez <fperez@colorado.edu>
3842
3855
3843 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3856 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3844 what the mouse problem was. The trick is to use gnuplot with temp
3857 what the mouse problem was. The trick is to use gnuplot with temp
3845 files and NOT with pipes (for data communication), because having
3858 files and NOT with pipes (for data communication), because having
3846 both pipes and the mouse on is bad news.
3859 both pipes and the mouse on is bad news.
3847
3860
3848 2002-05-13 Fernando Perez <fperez@colorado.edu>
3861 2002-05-13 Fernando Perez <fperez@colorado.edu>
3849
3862
3850 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3863 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3851 bug. Information would be reported about builtins even when
3864 bug. Information would be reported about builtins even when
3852 user-defined functions overrode them.
3865 user-defined functions overrode them.
3853
3866
3854 2002-05-11 Fernando Perez <fperez@colorado.edu>
3867 2002-05-11 Fernando Perez <fperez@colorado.edu>
3855
3868
3856 * IPython/__init__.py (__all__): removed FlexCompleter from
3869 * IPython/__init__.py (__all__): removed FlexCompleter from
3857 __all__ so that things don't fail in platforms without readline.
3870 __all__ so that things don't fail in platforms without readline.
3858
3871
3859 2002-05-10 Fernando Perez <fperez@colorado.edu>
3872 2002-05-10 Fernando Perez <fperez@colorado.edu>
3860
3873
3861 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3874 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3862 it requires Numeric, effectively making Numeric a dependency for
3875 it requires Numeric, effectively making Numeric a dependency for
3863 IPython.
3876 IPython.
3864
3877
3865 * Released 0.2.13
3878 * Released 0.2.13
3866
3879
3867 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3880 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3868 profiler interface. Now all the major options from the profiler
3881 profiler interface. Now all the major options from the profiler
3869 module are directly supported in IPython, both for single
3882 module are directly supported in IPython, both for single
3870 expressions (@prun) and for full programs (@run -p).
3883 expressions (@prun) and for full programs (@run -p).
3871
3884
3872 2002-05-09 Fernando Perez <fperez@colorado.edu>
3885 2002-05-09 Fernando Perez <fperez@colorado.edu>
3873
3886
3874 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3887 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3875 magic properly formatted for screen.
3888 magic properly formatted for screen.
3876
3889
3877 * setup.py (make_shortcut): Changed things to put pdf version in
3890 * setup.py (make_shortcut): Changed things to put pdf version in
3878 doc/ instead of doc/manual (had to change lyxport a bit).
3891 doc/ instead of doc/manual (had to change lyxport a bit).
3879
3892
3880 * IPython/Magic.py (Profile.string_stats): made profile runs go
3893 * IPython/Magic.py (Profile.string_stats): made profile runs go
3881 through pager (they are long and a pager allows searching, saving,
3894 through pager (they are long and a pager allows searching, saving,
3882 etc.)
3895 etc.)
3883
3896
3884 2002-05-08 Fernando Perez <fperez@colorado.edu>
3897 2002-05-08 Fernando Perez <fperez@colorado.edu>
3885
3898
3886 * Released 0.2.12
3899 * Released 0.2.12
3887
3900
3888 2002-05-06 Fernando Perez <fperez@colorado.edu>
3901 2002-05-06 Fernando Perez <fperez@colorado.edu>
3889
3902
3890 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3903 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3891 introduced); 'hist n1 n2' was broken.
3904 introduced); 'hist n1 n2' was broken.
3892 (Magic.magic_pdb): added optional on/off arguments to @pdb
3905 (Magic.magic_pdb): added optional on/off arguments to @pdb
3893 (Magic.magic_run): added option -i to @run, which executes code in
3906 (Magic.magic_run): added option -i to @run, which executes code in
3894 the IPython namespace instead of a clean one. Also added @irun as
3907 the IPython namespace instead of a clean one. Also added @irun as
3895 an alias to @run -i.
3908 an alias to @run -i.
3896
3909
3897 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3910 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3898 fixed (it didn't really do anything, the namespaces were wrong).
3911 fixed (it didn't really do anything, the namespaces were wrong).
3899
3912
3900 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3913 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3901
3914
3902 * IPython/__init__.py (__all__): Fixed package namespace, now
3915 * IPython/__init__.py (__all__): Fixed package namespace, now
3903 'import IPython' does give access to IPython.<all> as
3916 'import IPython' does give access to IPython.<all> as
3904 expected. Also renamed __release__ to Release.
3917 expected. Also renamed __release__ to Release.
3905
3918
3906 * IPython/Debugger.py (__license__): created new Pdb class which
3919 * IPython/Debugger.py (__license__): created new Pdb class which
3907 functions like a drop-in for the normal pdb.Pdb but does NOT
3920 functions like a drop-in for the normal pdb.Pdb but does NOT
3908 import readline by default. This way it doesn't muck up IPython's
3921 import readline by default. This way it doesn't muck up IPython's
3909 readline handling, and now tab-completion finally works in the
3922 readline handling, and now tab-completion finally works in the
3910 debugger -- sort of. It completes things globally visible, but the
3923 debugger -- sort of. It completes things globally visible, but the
3911 completer doesn't track the stack as pdb walks it. That's a bit
3924 completer doesn't track the stack as pdb walks it. That's a bit
3912 tricky, and I'll have to implement it later.
3925 tricky, and I'll have to implement it later.
3913
3926
3914 2002-05-05 Fernando Perez <fperez@colorado.edu>
3927 2002-05-05 Fernando Perez <fperez@colorado.edu>
3915
3928
3916 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3929 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3917 magic docstrings when printed via ? (explicit \'s were being
3930 magic docstrings when printed via ? (explicit \'s were being
3918 printed).
3931 printed).
3919
3932
3920 * IPython/ipmaker.py (make_IPython): fixed namespace
3933 * IPython/ipmaker.py (make_IPython): fixed namespace
3921 identification bug. Now variables loaded via logs or command-line
3934 identification bug. Now variables loaded via logs or command-line
3922 files are recognized in the interactive namespace by @who.
3935 files are recognized in the interactive namespace by @who.
3923
3936
3924 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3937 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3925 log replay system stemming from the string form of Structs.
3938 log replay system stemming from the string form of Structs.
3926
3939
3927 * IPython/Magic.py (Macro.__init__): improved macros to properly
3940 * IPython/Magic.py (Macro.__init__): improved macros to properly
3928 handle magic commands in them.
3941 handle magic commands in them.
3929 (Magic.magic_logstart): usernames are now expanded so 'logstart
3942 (Magic.magic_logstart): usernames are now expanded so 'logstart
3930 ~/mylog' now works.
3943 ~/mylog' now works.
3931
3944
3932 * IPython/iplib.py (complete): fixed bug where paths starting with
3945 * IPython/iplib.py (complete): fixed bug where paths starting with
3933 '/' would be completed as magic names.
3946 '/' would be completed as magic names.
3934
3947
3935 2002-05-04 Fernando Perez <fperez@colorado.edu>
3948 2002-05-04 Fernando Perez <fperez@colorado.edu>
3936
3949
3937 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3950 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3938 allow running full programs under the profiler's control.
3951 allow running full programs under the profiler's control.
3939
3952
3940 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3953 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3941 mode to report exceptions verbosely but without formatting
3954 mode to report exceptions verbosely but without formatting
3942 variables. This addresses the issue of ipython 'freezing' (it's
3955 variables. This addresses the issue of ipython 'freezing' (it's
3943 not frozen, but caught in an expensive formatting loop) when huge
3956 not frozen, but caught in an expensive formatting loop) when huge
3944 variables are in the context of an exception.
3957 variables are in the context of an exception.
3945 (VerboseTB.text): Added '--->' markers at line where exception was
3958 (VerboseTB.text): Added '--->' markers at line where exception was
3946 triggered. Much clearer to read, especially in NoColor modes.
3959 triggered. Much clearer to read, especially in NoColor modes.
3947
3960
3948 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3961 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3949 implemented in reverse when changing to the new parse_options().
3962 implemented in reverse when changing to the new parse_options().
3950
3963
3951 2002-05-03 Fernando Perez <fperez@colorado.edu>
3964 2002-05-03 Fernando Perez <fperez@colorado.edu>
3952
3965
3953 * IPython/Magic.py (Magic.parse_options): new function so that
3966 * IPython/Magic.py (Magic.parse_options): new function so that
3954 magics can parse options easier.
3967 magics can parse options easier.
3955 (Magic.magic_prun): new function similar to profile.run(),
3968 (Magic.magic_prun): new function similar to profile.run(),
3956 suggested by Chris Hart.
3969 suggested by Chris Hart.
3957 (Magic.magic_cd): fixed behavior so that it only changes if
3970 (Magic.magic_cd): fixed behavior so that it only changes if
3958 directory actually is in history.
3971 directory actually is in history.
3959
3972
3960 * IPython/usage.py (__doc__): added information about potential
3973 * IPython/usage.py (__doc__): added information about potential
3961 slowness of Verbose exception mode when there are huge data
3974 slowness of Verbose exception mode when there are huge data
3962 structures to be formatted (thanks to Archie Paulson).
3975 structures to be formatted (thanks to Archie Paulson).
3963
3976
3964 * IPython/ipmaker.py (make_IPython): Changed default logging
3977 * IPython/ipmaker.py (make_IPython): Changed default logging
3965 (when simply called with -log) to use curr_dir/ipython.log in
3978 (when simply called with -log) to use curr_dir/ipython.log in
3966 rotate mode. Fixed crash which was occuring with -log before
3979 rotate mode. Fixed crash which was occuring with -log before
3967 (thanks to Jim Boyle).
3980 (thanks to Jim Boyle).
3968
3981
3969 2002-05-01 Fernando Perez <fperez@colorado.edu>
3982 2002-05-01 Fernando Perez <fperez@colorado.edu>
3970
3983
3971 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3984 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3972 was nasty -- though somewhat of a corner case).
3985 was nasty -- though somewhat of a corner case).
3973
3986
3974 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3987 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3975 text (was a bug).
3988 text (was a bug).
3976
3989
3977 2002-04-30 Fernando Perez <fperez@colorado.edu>
3990 2002-04-30 Fernando Perez <fperez@colorado.edu>
3978
3991
3979 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3992 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3980 a print after ^D or ^C from the user so that the In[] prompt
3993 a print after ^D or ^C from the user so that the In[] prompt
3981 doesn't over-run the gnuplot one.
3994 doesn't over-run the gnuplot one.
3982
3995
3983 2002-04-29 Fernando Perez <fperez@colorado.edu>
3996 2002-04-29 Fernando Perez <fperez@colorado.edu>
3984
3997
3985 * Released 0.2.10
3998 * Released 0.2.10
3986
3999
3987 * IPython/__release__.py (version): get date dynamically.
4000 * IPython/__release__.py (version): get date dynamically.
3988
4001
3989 * Misc. documentation updates thanks to Arnd's comments. Also ran
4002 * Misc. documentation updates thanks to Arnd's comments. Also ran
3990 a full spellcheck on the manual (hadn't been done in a while).
4003 a full spellcheck on the manual (hadn't been done in a while).
3991
4004
3992 2002-04-27 Fernando Perez <fperez@colorado.edu>
4005 2002-04-27 Fernando Perez <fperez@colorado.edu>
3993
4006
3994 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4007 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3995 starting a log in mid-session would reset the input history list.
4008 starting a log in mid-session would reset the input history list.
3996
4009
3997 2002-04-26 Fernando Perez <fperez@colorado.edu>
4010 2002-04-26 Fernando Perez <fperez@colorado.edu>
3998
4011
3999 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4012 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4000 all files were being included in an update. Now anything in
4013 all files were being included in an update. Now anything in
4001 UserConfig that matches [A-Za-z]*.py will go (this excludes
4014 UserConfig that matches [A-Za-z]*.py will go (this excludes
4002 __init__.py)
4015 __init__.py)
4003
4016
4004 2002-04-25 Fernando Perez <fperez@colorado.edu>
4017 2002-04-25 Fernando Perez <fperez@colorado.edu>
4005
4018
4006 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4019 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4007 to __builtins__ so that any form of embedded or imported code can
4020 to __builtins__ so that any form of embedded or imported code can
4008 test for being inside IPython.
4021 test for being inside IPython.
4009
4022
4010 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4023 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4011 changed to GnuplotMagic because it's now an importable module,
4024 changed to GnuplotMagic because it's now an importable module,
4012 this makes the name follow that of the standard Gnuplot module.
4025 this makes the name follow that of the standard Gnuplot module.
4013 GnuplotMagic can now be loaded at any time in mid-session.
4026 GnuplotMagic can now be loaded at any time in mid-session.
4014
4027
4015 2002-04-24 Fernando Perez <fperez@colorado.edu>
4028 2002-04-24 Fernando Perez <fperez@colorado.edu>
4016
4029
4017 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4030 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4018 the globals (IPython has its own namespace) and the
4031 the globals (IPython has its own namespace) and the
4019 PhysicalQuantity stuff is much better anyway.
4032 PhysicalQuantity stuff is much better anyway.
4020
4033
4021 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4034 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4022 embedding example to standard user directory for
4035 embedding example to standard user directory for
4023 distribution. Also put it in the manual.
4036 distribution. Also put it in the manual.
4024
4037
4025 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4038 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4026 instance as first argument (so it doesn't rely on some obscure
4039 instance as first argument (so it doesn't rely on some obscure
4027 hidden global).
4040 hidden global).
4028
4041
4029 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4042 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4030 delimiters. While it prevents ().TAB from working, it allows
4043 delimiters. While it prevents ().TAB from working, it allows
4031 completions in open (... expressions. This is by far a more common
4044 completions in open (... expressions. This is by far a more common
4032 case.
4045 case.
4033
4046
4034 2002-04-23 Fernando Perez <fperez@colorado.edu>
4047 2002-04-23 Fernando Perez <fperez@colorado.edu>
4035
4048
4036 * IPython/Extensions/InterpreterPasteInput.py: new
4049 * IPython/Extensions/InterpreterPasteInput.py: new
4037 syntax-processing module for pasting lines with >>> or ... at the
4050 syntax-processing module for pasting lines with >>> or ... at the
4038 start.
4051 start.
4039
4052
4040 * IPython/Extensions/PhysicalQ_Interactive.py
4053 * IPython/Extensions/PhysicalQ_Interactive.py
4041 (PhysicalQuantityInteractive.__int__): fixed to work with either
4054 (PhysicalQuantityInteractive.__int__): fixed to work with either
4042 Numeric or math.
4055 Numeric or math.
4043
4056
4044 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4057 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4045 provided profiles. Now we have:
4058 provided profiles. Now we have:
4046 -math -> math module as * and cmath with its own namespace.
4059 -math -> math module as * and cmath with its own namespace.
4047 -numeric -> Numeric as *, plus gnuplot & grace
4060 -numeric -> Numeric as *, plus gnuplot & grace
4048 -physics -> same as before
4061 -physics -> same as before
4049
4062
4050 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4063 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4051 user-defined magics wouldn't be found by @magic if they were
4064 user-defined magics wouldn't be found by @magic if they were
4052 defined as class methods. Also cleaned up the namespace search
4065 defined as class methods. Also cleaned up the namespace search
4053 logic and the string building (to use %s instead of many repeated
4066 logic and the string building (to use %s instead of many repeated
4054 string adds).
4067 string adds).
4055
4068
4056 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4069 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4057 of user-defined magics to operate with class methods (cleaner, in
4070 of user-defined magics to operate with class methods (cleaner, in
4058 line with the gnuplot code).
4071 line with the gnuplot code).
4059
4072
4060 2002-04-22 Fernando Perez <fperez@colorado.edu>
4073 2002-04-22 Fernando Perez <fperez@colorado.edu>
4061
4074
4062 * setup.py: updated dependency list so that manual is updated when
4075 * setup.py: updated dependency list so that manual is updated when
4063 all included files change.
4076 all included files change.
4064
4077
4065 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4078 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4066 the delimiter removal option (the fix is ugly right now).
4079 the delimiter removal option (the fix is ugly right now).
4067
4080
4068 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4081 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4069 all of the math profile (quicker loading, no conflict between
4082 all of the math profile (quicker loading, no conflict between
4070 g-9.8 and g-gnuplot).
4083 g-9.8 and g-gnuplot).
4071
4084
4072 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4085 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4073 name of post-mortem files to IPython_crash_report.txt.
4086 name of post-mortem files to IPython_crash_report.txt.
4074
4087
4075 * Cleanup/update of the docs. Added all the new readline info and
4088 * Cleanup/update of the docs. Added all the new readline info and
4076 formatted all lists as 'real lists'.
4089 formatted all lists as 'real lists'.
4077
4090
4078 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4091 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4079 tab-completion options, since the full readline parse_and_bind is
4092 tab-completion options, since the full readline parse_and_bind is
4080 now accessible.
4093 now accessible.
4081
4094
4082 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4095 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4083 handling of readline options. Now users can specify any string to
4096 handling of readline options. Now users can specify any string to
4084 be passed to parse_and_bind(), as well as the delimiters to be
4097 be passed to parse_and_bind(), as well as the delimiters to be
4085 removed.
4098 removed.
4086 (InteractiveShell.__init__): Added __name__ to the global
4099 (InteractiveShell.__init__): Added __name__ to the global
4087 namespace so that things like Itpl which rely on its existence
4100 namespace so that things like Itpl which rely on its existence
4088 don't crash.
4101 don't crash.
4089 (InteractiveShell._prefilter): Defined the default with a _ so
4102 (InteractiveShell._prefilter): Defined the default with a _ so
4090 that prefilter() is easier to override, while the default one
4103 that prefilter() is easier to override, while the default one
4091 remains available.
4104 remains available.
4092
4105
4093 2002-04-18 Fernando Perez <fperez@colorado.edu>
4106 2002-04-18 Fernando Perez <fperez@colorado.edu>
4094
4107
4095 * Added information about pdb in the docs.
4108 * Added information about pdb in the docs.
4096
4109
4097 2002-04-17 Fernando Perez <fperez@colorado.edu>
4110 2002-04-17 Fernando Perez <fperez@colorado.edu>
4098
4111
4099 * IPython/ipmaker.py (make_IPython): added rc_override option to
4112 * IPython/ipmaker.py (make_IPython): added rc_override option to
4100 allow passing config options at creation time which may override
4113 allow passing config options at creation time which may override
4101 anything set in the config files or command line. This is
4114 anything set in the config files or command line. This is
4102 particularly useful for configuring embedded instances.
4115 particularly useful for configuring embedded instances.
4103
4116
4104 2002-04-15 Fernando Perez <fperez@colorado.edu>
4117 2002-04-15 Fernando Perez <fperez@colorado.edu>
4105
4118
4106 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4119 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4107 crash embedded instances because of the input cache falling out of
4120 crash embedded instances because of the input cache falling out of
4108 sync with the output counter.
4121 sync with the output counter.
4109
4122
4110 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4123 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4111 mode which calls pdb after an uncaught exception in IPython itself.
4124 mode which calls pdb after an uncaught exception in IPython itself.
4112
4125
4113 2002-04-14 Fernando Perez <fperez@colorado.edu>
4126 2002-04-14 Fernando Perez <fperez@colorado.edu>
4114
4127
4115 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4128 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4116 readline, fix it back after each call.
4129 readline, fix it back after each call.
4117
4130
4118 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4131 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4119 method to force all access via __call__(), which guarantees that
4132 method to force all access via __call__(), which guarantees that
4120 traceback references are properly deleted.
4133 traceback references are properly deleted.
4121
4134
4122 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4135 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4123 improve printing when pprint is in use.
4136 improve printing when pprint is in use.
4124
4137
4125 2002-04-13 Fernando Perez <fperez@colorado.edu>
4138 2002-04-13 Fernando Perez <fperez@colorado.edu>
4126
4139
4127 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4140 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4128 exceptions aren't caught anymore. If the user triggers one, he
4141 exceptions aren't caught anymore. If the user triggers one, he
4129 should know why he's doing it and it should go all the way up,
4142 should know why he's doing it and it should go all the way up,
4130 just like any other exception. So now @abort will fully kill the
4143 just like any other exception. So now @abort will fully kill the
4131 embedded interpreter and the embedding code (unless that happens
4144 embedded interpreter and the embedding code (unless that happens
4132 to catch SystemExit).
4145 to catch SystemExit).
4133
4146
4134 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4147 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4135 and a debugger() method to invoke the interactive pdb debugger
4148 and a debugger() method to invoke the interactive pdb debugger
4136 after printing exception information. Also added the corresponding
4149 after printing exception information. Also added the corresponding
4137 -pdb option and @pdb magic to control this feature, and updated
4150 -pdb option and @pdb magic to control this feature, and updated
4138 the docs. After a suggestion from Christopher Hart
4151 the docs. After a suggestion from Christopher Hart
4139 (hart-AT-caltech.edu).
4152 (hart-AT-caltech.edu).
4140
4153
4141 2002-04-12 Fernando Perez <fperez@colorado.edu>
4154 2002-04-12 Fernando Perez <fperez@colorado.edu>
4142
4155
4143 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4156 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4144 the exception handlers defined by the user (not the CrashHandler)
4157 the exception handlers defined by the user (not the CrashHandler)
4145 so that user exceptions don't trigger an ipython bug report.
4158 so that user exceptions don't trigger an ipython bug report.
4146
4159
4147 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4160 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4148 configurable (it should have always been so).
4161 configurable (it should have always been so).
4149
4162
4150 2002-03-26 Fernando Perez <fperez@colorado.edu>
4163 2002-03-26 Fernando Perez <fperez@colorado.edu>
4151
4164
4152 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4165 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4153 and there to fix embedding namespace issues. This should all be
4166 and there to fix embedding namespace issues. This should all be
4154 done in a more elegant way.
4167 done in a more elegant way.
4155
4168
4156 2002-03-25 Fernando Perez <fperez@colorado.edu>
4169 2002-03-25 Fernando Perez <fperez@colorado.edu>
4157
4170
4158 * IPython/genutils.py (get_home_dir): Try to make it work under
4171 * IPython/genutils.py (get_home_dir): Try to make it work under
4159 win9x also.
4172 win9x also.
4160
4173
4161 2002-03-20 Fernando Perez <fperez@colorado.edu>
4174 2002-03-20 Fernando Perez <fperez@colorado.edu>
4162
4175
4163 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4176 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4164 sys.displayhook untouched upon __init__.
4177 sys.displayhook untouched upon __init__.
4165
4178
4166 2002-03-19 Fernando Perez <fperez@colorado.edu>
4179 2002-03-19 Fernando Perez <fperez@colorado.edu>
4167
4180
4168 * Released 0.2.9 (for embedding bug, basically).
4181 * Released 0.2.9 (for embedding bug, basically).
4169
4182
4170 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4183 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4171 exceptions so that enclosing shell's state can be restored.
4184 exceptions so that enclosing shell's state can be restored.
4172
4185
4173 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4186 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4174 naming conventions in the .ipython/ dir.
4187 naming conventions in the .ipython/ dir.
4175
4188
4176 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4189 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4177 from delimiters list so filenames with - in them get expanded.
4190 from delimiters list so filenames with - in them get expanded.
4178
4191
4179 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4192 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4180 sys.displayhook not being properly restored after an embedded call.
4193 sys.displayhook not being properly restored after an embedded call.
4181
4194
4182 2002-03-18 Fernando Perez <fperez@colorado.edu>
4195 2002-03-18 Fernando Perez <fperez@colorado.edu>
4183
4196
4184 * Released 0.2.8
4197 * Released 0.2.8
4185
4198
4186 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4199 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4187 some files weren't being included in a -upgrade.
4200 some files weren't being included in a -upgrade.
4188 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4201 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4189 on' so that the first tab completes.
4202 on' so that the first tab completes.
4190 (InteractiveShell.handle_magic): fixed bug with spaces around
4203 (InteractiveShell.handle_magic): fixed bug with spaces around
4191 quotes breaking many magic commands.
4204 quotes breaking many magic commands.
4192
4205
4193 * setup.py: added note about ignoring the syntax error messages at
4206 * setup.py: added note about ignoring the syntax error messages at
4194 installation.
4207 installation.
4195
4208
4196 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4209 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4197 streamlining the gnuplot interface, now there's only one magic @gp.
4210 streamlining the gnuplot interface, now there's only one magic @gp.
4198
4211
4199 2002-03-17 Fernando Perez <fperez@colorado.edu>
4212 2002-03-17 Fernando Perez <fperez@colorado.edu>
4200
4213
4201 * IPython/UserConfig/magic_gnuplot.py: new name for the
4214 * IPython/UserConfig/magic_gnuplot.py: new name for the
4202 example-magic_pm.py file. Much enhanced system, now with a shell
4215 example-magic_pm.py file. Much enhanced system, now with a shell
4203 for communicating directly with gnuplot, one command at a time.
4216 for communicating directly with gnuplot, one command at a time.
4204
4217
4205 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4218 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4206 setting __name__=='__main__'.
4219 setting __name__=='__main__'.
4207
4220
4208 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4221 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4209 mini-shell for accessing gnuplot from inside ipython. Should
4222 mini-shell for accessing gnuplot from inside ipython. Should
4210 extend it later for grace access too. Inspired by Arnd's
4223 extend it later for grace access too. Inspired by Arnd's
4211 suggestion.
4224 suggestion.
4212
4225
4213 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4226 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4214 calling magic functions with () in their arguments. Thanks to Arnd
4227 calling magic functions with () in their arguments. Thanks to Arnd
4215 Baecker for pointing this to me.
4228 Baecker for pointing this to me.
4216
4229
4217 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4230 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4218 infinitely for integer or complex arrays (only worked with floats).
4231 infinitely for integer or complex arrays (only worked with floats).
4219
4232
4220 2002-03-16 Fernando Perez <fperez@colorado.edu>
4233 2002-03-16 Fernando Perez <fperez@colorado.edu>
4221
4234
4222 * setup.py: Merged setup and setup_windows into a single script
4235 * setup.py: Merged setup and setup_windows into a single script
4223 which properly handles things for windows users.
4236 which properly handles things for windows users.
4224
4237
4225 2002-03-15 Fernando Perez <fperez@colorado.edu>
4238 2002-03-15 Fernando Perez <fperez@colorado.edu>
4226
4239
4227 * Big change to the manual: now the magics are all automatically
4240 * Big change to the manual: now the magics are all automatically
4228 documented. This information is generated from their docstrings
4241 documented. This information is generated from their docstrings
4229 and put in a latex file included by the manual lyx file. This way
4242 and put in a latex file included by the manual lyx file. This way
4230 we get always up to date information for the magics. The manual
4243 we get always up to date information for the magics. The manual
4231 now also has proper version information, also auto-synced.
4244 now also has proper version information, also auto-synced.
4232
4245
4233 For this to work, an undocumented --magic_docstrings option was added.
4246 For this to work, an undocumented --magic_docstrings option was added.
4234
4247
4235 2002-03-13 Fernando Perez <fperez@colorado.edu>
4248 2002-03-13 Fernando Perez <fperez@colorado.edu>
4236
4249
4237 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4250 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4238 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4251 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4239
4252
4240 2002-03-12 Fernando Perez <fperez@colorado.edu>
4253 2002-03-12 Fernando Perez <fperez@colorado.edu>
4241
4254
4242 * IPython/ultraTB.py (TermColors): changed color escapes again to
4255 * IPython/ultraTB.py (TermColors): changed color escapes again to
4243 fix the (old, reintroduced) line-wrapping bug. Basically, if
4256 fix the (old, reintroduced) line-wrapping bug. Basically, if
4244 \001..\002 aren't given in the color escapes, lines get wrapped
4257 \001..\002 aren't given in the color escapes, lines get wrapped
4245 weirdly. But giving those screws up old xterms and emacs terms. So
4258 weirdly. But giving those screws up old xterms and emacs terms. So
4246 I added some logic for emacs terms to be ok, but I can't identify old
4259 I added some logic for emacs terms to be ok, but I can't identify old
4247 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4260 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4248
4261
4249 2002-03-10 Fernando Perez <fperez@colorado.edu>
4262 2002-03-10 Fernando Perez <fperez@colorado.edu>
4250
4263
4251 * IPython/usage.py (__doc__): Various documentation cleanups and
4264 * IPython/usage.py (__doc__): Various documentation cleanups and
4252 updates, both in usage docstrings and in the manual.
4265 updates, both in usage docstrings and in the manual.
4253
4266
4254 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4267 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4255 handling of caching. Set minimum acceptabe value for having a
4268 handling of caching. Set minimum acceptabe value for having a
4256 cache at 20 values.
4269 cache at 20 values.
4257
4270
4258 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4271 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4259 install_first_time function to a method, renamed it and added an
4272 install_first_time function to a method, renamed it and added an
4260 'upgrade' mode. Now people can update their config directory with
4273 'upgrade' mode. Now people can update their config directory with
4261 a simple command line switch (-upgrade, also new).
4274 a simple command line switch (-upgrade, also new).
4262
4275
4263 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4276 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4264 @file (convenient for automagic users under Python >= 2.2).
4277 @file (convenient for automagic users under Python >= 2.2).
4265 Removed @files (it seemed more like a plural than an abbrev. of
4278 Removed @files (it seemed more like a plural than an abbrev. of
4266 'file show').
4279 'file show').
4267
4280
4268 * IPython/iplib.py (install_first_time): Fixed crash if there were
4281 * IPython/iplib.py (install_first_time): Fixed crash if there were
4269 backup files ('~') in .ipython/ install directory.
4282 backup files ('~') in .ipython/ install directory.
4270
4283
4271 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4284 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4272 system. Things look fine, but these changes are fairly
4285 system. Things look fine, but these changes are fairly
4273 intrusive. Test them for a few days.
4286 intrusive. Test them for a few days.
4274
4287
4275 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4288 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4276 the prompts system. Now all in/out prompt strings are user
4289 the prompts system. Now all in/out prompt strings are user
4277 controllable. This is particularly useful for embedding, as one
4290 controllable. This is particularly useful for embedding, as one
4278 can tag embedded instances with particular prompts.
4291 can tag embedded instances with particular prompts.
4279
4292
4280 Also removed global use of sys.ps1/2, which now allows nested
4293 Also removed global use of sys.ps1/2, which now allows nested
4281 embeddings without any problems. Added command-line options for
4294 embeddings without any problems. Added command-line options for
4282 the prompt strings.
4295 the prompt strings.
4283
4296
4284 2002-03-08 Fernando Perez <fperez@colorado.edu>
4297 2002-03-08 Fernando Perez <fperez@colorado.edu>
4285
4298
4286 * IPython/UserConfig/example-embed-short.py (ipshell): added
4299 * IPython/UserConfig/example-embed-short.py (ipshell): added
4287 example file with the bare minimum code for embedding.
4300 example file with the bare minimum code for embedding.
4288
4301
4289 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4302 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4290 functionality for the embeddable shell to be activated/deactivated
4303 functionality for the embeddable shell to be activated/deactivated
4291 either globally or at each call.
4304 either globally or at each call.
4292
4305
4293 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4306 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4294 rewriting the prompt with '--->' for auto-inputs with proper
4307 rewriting the prompt with '--->' for auto-inputs with proper
4295 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4308 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4296 this is handled by the prompts class itself, as it should.
4309 this is handled by the prompts class itself, as it should.
4297
4310
4298 2002-03-05 Fernando Perez <fperez@colorado.edu>
4311 2002-03-05 Fernando Perez <fperez@colorado.edu>
4299
4312
4300 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4313 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4301 @logstart to avoid name clashes with the math log function.
4314 @logstart to avoid name clashes with the math log function.
4302
4315
4303 * Big updates to X/Emacs section of the manual.
4316 * Big updates to X/Emacs section of the manual.
4304
4317
4305 * Removed ipython_emacs. Milan explained to me how to pass
4318 * Removed ipython_emacs. Milan explained to me how to pass
4306 arguments to ipython through Emacs. Some day I'm going to end up
4319 arguments to ipython through Emacs. Some day I'm going to end up
4307 learning some lisp...
4320 learning some lisp...
4308
4321
4309 2002-03-04 Fernando Perez <fperez@colorado.edu>
4322 2002-03-04 Fernando Perez <fperez@colorado.edu>
4310
4323
4311 * IPython/ipython_emacs: Created script to be used as the
4324 * IPython/ipython_emacs: Created script to be used as the
4312 py-python-command Emacs variable so we can pass IPython
4325 py-python-command Emacs variable so we can pass IPython
4313 parameters. I can't figure out how to tell Emacs directly to pass
4326 parameters. I can't figure out how to tell Emacs directly to pass
4314 parameters to IPython, so a dummy shell script will do it.
4327 parameters to IPython, so a dummy shell script will do it.
4315
4328
4316 Other enhancements made for things to work better under Emacs'
4329 Other enhancements made for things to work better under Emacs'
4317 various types of terminals. Many thanks to Milan Zamazal
4330 various types of terminals. Many thanks to Milan Zamazal
4318 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4331 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4319
4332
4320 2002-03-01 Fernando Perez <fperez@colorado.edu>
4333 2002-03-01 Fernando Perez <fperez@colorado.edu>
4321
4334
4322 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4335 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4323 that loading of readline is now optional. This gives better
4336 that loading of readline is now optional. This gives better
4324 control to emacs users.
4337 control to emacs users.
4325
4338
4326 * IPython/ultraTB.py (__date__): Modified color escape sequences
4339 * IPython/ultraTB.py (__date__): Modified color escape sequences
4327 and now things work fine under xterm and in Emacs' term buffers
4340 and now things work fine under xterm and in Emacs' term buffers
4328 (though not shell ones). Well, in emacs you get colors, but all
4341 (though not shell ones). Well, in emacs you get colors, but all
4329 seem to be 'light' colors (no difference between dark and light
4342 seem to be 'light' colors (no difference between dark and light
4330 ones). But the garbage chars are gone, and also in xterms. It
4343 ones). But the garbage chars are gone, and also in xterms. It
4331 seems that now I'm using 'cleaner' ansi sequences.
4344 seems that now I'm using 'cleaner' ansi sequences.
4332
4345
4333 2002-02-21 Fernando Perez <fperez@colorado.edu>
4346 2002-02-21 Fernando Perez <fperez@colorado.edu>
4334
4347
4335 * Released 0.2.7 (mainly to publish the scoping fix).
4348 * Released 0.2.7 (mainly to publish the scoping fix).
4336
4349
4337 * IPython/Logger.py (Logger.logstate): added. A corresponding
4350 * IPython/Logger.py (Logger.logstate): added. A corresponding
4338 @logstate magic was created.
4351 @logstate magic was created.
4339
4352
4340 * IPython/Magic.py: fixed nested scoping problem under Python
4353 * IPython/Magic.py: fixed nested scoping problem under Python
4341 2.1.x (automagic wasn't working).
4354 2.1.x (automagic wasn't working).
4342
4355
4343 2002-02-20 Fernando Perez <fperez@colorado.edu>
4356 2002-02-20 Fernando Perez <fperez@colorado.edu>
4344
4357
4345 * Released 0.2.6.
4358 * Released 0.2.6.
4346
4359
4347 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4360 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4348 option so that logs can come out without any headers at all.
4361 option so that logs can come out without any headers at all.
4349
4362
4350 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4363 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4351 SciPy.
4364 SciPy.
4352
4365
4353 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4366 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4354 that embedded IPython calls don't require vars() to be explicitly
4367 that embedded IPython calls don't require vars() to be explicitly
4355 passed. Now they are extracted from the caller's frame (code
4368 passed. Now they are extracted from the caller's frame (code
4356 snatched from Eric Jones' weave). Added better documentation to
4369 snatched from Eric Jones' weave). Added better documentation to
4357 the section on embedding and the example file.
4370 the section on embedding and the example file.
4358
4371
4359 * IPython/genutils.py (page): Changed so that under emacs, it just
4372 * IPython/genutils.py (page): Changed so that under emacs, it just
4360 prints the string. You can then page up and down in the emacs
4373 prints the string. You can then page up and down in the emacs
4361 buffer itself. This is how the builtin help() works.
4374 buffer itself. This is how the builtin help() works.
4362
4375
4363 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4376 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4364 macro scoping: macros need to be executed in the user's namespace
4377 macro scoping: macros need to be executed in the user's namespace
4365 to work as if they had been typed by the user.
4378 to work as if they had been typed by the user.
4366
4379
4367 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4380 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4368 execute automatically (no need to type 'exec...'). They then
4381 execute automatically (no need to type 'exec...'). They then
4369 behave like 'true macros'. The printing system was also modified
4382 behave like 'true macros'. The printing system was also modified
4370 for this to work.
4383 for this to work.
4371
4384
4372 2002-02-19 Fernando Perez <fperez@colorado.edu>
4385 2002-02-19 Fernando Perez <fperez@colorado.edu>
4373
4386
4374 * IPython/genutils.py (page_file): new function for paging files
4387 * IPython/genutils.py (page_file): new function for paging files
4375 in an OS-independent way. Also necessary for file viewing to work
4388 in an OS-independent way. Also necessary for file viewing to work
4376 well inside Emacs buffers.
4389 well inside Emacs buffers.
4377 (page): Added checks for being in an emacs buffer.
4390 (page): Added checks for being in an emacs buffer.
4378 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4391 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4379 same bug in iplib.
4392 same bug in iplib.
4380
4393
4381 2002-02-18 Fernando Perez <fperez@colorado.edu>
4394 2002-02-18 Fernando Perez <fperez@colorado.edu>
4382
4395
4383 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4396 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4384 of readline so that IPython can work inside an Emacs buffer.
4397 of readline so that IPython can work inside an Emacs buffer.
4385
4398
4386 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4399 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4387 method signatures (they weren't really bugs, but it looks cleaner
4400 method signatures (they weren't really bugs, but it looks cleaner
4388 and keeps PyChecker happy).
4401 and keeps PyChecker happy).
4389
4402
4390 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4403 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4391 for implementing various user-defined hooks. Currently only
4404 for implementing various user-defined hooks. Currently only
4392 display is done.
4405 display is done.
4393
4406
4394 * IPython/Prompts.py (CachedOutput._display): changed display
4407 * IPython/Prompts.py (CachedOutput._display): changed display
4395 functions so that they can be dynamically changed by users easily.
4408 functions so that they can be dynamically changed by users easily.
4396
4409
4397 * IPython/Extensions/numeric_formats.py (num_display): added an
4410 * IPython/Extensions/numeric_formats.py (num_display): added an
4398 extension for printing NumPy arrays in flexible manners. It
4411 extension for printing NumPy arrays in flexible manners. It
4399 doesn't do anything yet, but all the structure is in
4412 doesn't do anything yet, but all the structure is in
4400 place. Ultimately the plan is to implement output format control
4413 place. Ultimately the plan is to implement output format control
4401 like in Octave.
4414 like in Octave.
4402
4415
4403 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4416 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4404 methods are found at run-time by all the automatic machinery.
4417 methods are found at run-time by all the automatic machinery.
4405
4418
4406 2002-02-17 Fernando Perez <fperez@colorado.edu>
4419 2002-02-17 Fernando Perez <fperez@colorado.edu>
4407
4420
4408 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4421 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4409 whole file a little.
4422 whole file a little.
4410
4423
4411 * ToDo: closed this document. Now there's a new_design.lyx
4424 * ToDo: closed this document. Now there's a new_design.lyx
4412 document for all new ideas. Added making a pdf of it for the
4425 document for all new ideas. Added making a pdf of it for the
4413 end-user distro.
4426 end-user distro.
4414
4427
4415 * IPython/Logger.py (Logger.switch_log): Created this to replace
4428 * IPython/Logger.py (Logger.switch_log): Created this to replace
4416 logon() and logoff(). It also fixes a nasty crash reported by
4429 logon() and logoff(). It also fixes a nasty crash reported by
4417 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4430 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4418
4431
4419 * IPython/iplib.py (complete): got auto-completion to work with
4432 * IPython/iplib.py (complete): got auto-completion to work with
4420 automagic (I had wanted this for a long time).
4433 automagic (I had wanted this for a long time).
4421
4434
4422 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4435 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4423 to @file, since file() is now a builtin and clashes with automagic
4436 to @file, since file() is now a builtin and clashes with automagic
4424 for @file.
4437 for @file.
4425
4438
4426 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4439 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4427 of this was previously in iplib, which had grown to more than 2000
4440 of this was previously in iplib, which had grown to more than 2000
4428 lines, way too long. No new functionality, but it makes managing
4441 lines, way too long. No new functionality, but it makes managing
4429 the code a bit easier.
4442 the code a bit easier.
4430
4443
4431 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4444 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4432 information to crash reports.
4445 information to crash reports.
4433
4446
4434 2002-02-12 Fernando Perez <fperez@colorado.edu>
4447 2002-02-12 Fernando Perez <fperez@colorado.edu>
4435
4448
4436 * Released 0.2.5.
4449 * Released 0.2.5.
4437
4450
4438 2002-02-11 Fernando Perez <fperez@colorado.edu>
4451 2002-02-11 Fernando Perez <fperez@colorado.edu>
4439
4452
4440 * Wrote a relatively complete Windows installer. It puts
4453 * Wrote a relatively complete Windows installer. It puts
4441 everything in place, creates Start Menu entries and fixes the
4454 everything in place, creates Start Menu entries and fixes the
4442 color issues. Nothing fancy, but it works.
4455 color issues. Nothing fancy, but it works.
4443
4456
4444 2002-02-10 Fernando Perez <fperez@colorado.edu>
4457 2002-02-10 Fernando Perez <fperez@colorado.edu>
4445
4458
4446 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4459 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4447 os.path.expanduser() call so that we can type @run ~/myfile.py and
4460 os.path.expanduser() call so that we can type @run ~/myfile.py and
4448 have thigs work as expected.
4461 have thigs work as expected.
4449
4462
4450 * IPython/genutils.py (page): fixed exception handling so things
4463 * IPython/genutils.py (page): fixed exception handling so things
4451 work both in Unix and Windows correctly. Quitting a pager triggers
4464 work both in Unix and Windows correctly. Quitting a pager triggers
4452 an IOError/broken pipe in Unix, and in windows not finding a pager
4465 an IOError/broken pipe in Unix, and in windows not finding a pager
4453 is also an IOError, so I had to actually look at the return value
4466 is also an IOError, so I had to actually look at the return value
4454 of the exception, not just the exception itself. Should be ok now.
4467 of the exception, not just the exception itself. Should be ok now.
4455
4468
4456 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4469 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4457 modified to allow case-insensitive color scheme changes.
4470 modified to allow case-insensitive color scheme changes.
4458
4471
4459 2002-02-09 Fernando Perez <fperez@colorado.edu>
4472 2002-02-09 Fernando Perez <fperez@colorado.edu>
4460
4473
4461 * IPython/genutils.py (native_line_ends): new function to leave
4474 * IPython/genutils.py (native_line_ends): new function to leave
4462 user config files with os-native line-endings.
4475 user config files with os-native line-endings.
4463
4476
4464 * README and manual updates.
4477 * README and manual updates.
4465
4478
4466 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4479 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4467 instead of StringType to catch Unicode strings.
4480 instead of StringType to catch Unicode strings.
4468
4481
4469 * IPython/genutils.py (filefind): fixed bug for paths with
4482 * IPython/genutils.py (filefind): fixed bug for paths with
4470 embedded spaces (very common in Windows).
4483 embedded spaces (very common in Windows).
4471
4484
4472 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4485 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4473 files under Windows, so that they get automatically associated
4486 files under Windows, so that they get automatically associated
4474 with a text editor. Windows makes it a pain to handle
4487 with a text editor. Windows makes it a pain to handle
4475 extension-less files.
4488 extension-less files.
4476
4489
4477 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4490 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4478 warning about readline only occur for Posix. In Windows there's no
4491 warning about readline only occur for Posix. In Windows there's no
4479 way to get readline, so why bother with the warning.
4492 way to get readline, so why bother with the warning.
4480
4493
4481 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4494 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4482 for __str__ instead of dir(self), since dir() changed in 2.2.
4495 for __str__ instead of dir(self), since dir() changed in 2.2.
4483
4496
4484 * Ported to Windows! Tested on XP, I suspect it should work fine
4497 * Ported to Windows! Tested on XP, I suspect it should work fine
4485 on NT/2000, but I don't think it will work on 98 et al. That
4498 on NT/2000, but I don't think it will work on 98 et al. That
4486 series of Windows is such a piece of junk anyway that I won't try
4499 series of Windows is such a piece of junk anyway that I won't try
4487 porting it there. The XP port was straightforward, showed a few
4500 porting it there. The XP port was straightforward, showed a few
4488 bugs here and there (fixed all), in particular some string
4501 bugs here and there (fixed all), in particular some string
4489 handling stuff which required considering Unicode strings (which
4502 handling stuff which required considering Unicode strings (which
4490 Windows uses). This is good, but hasn't been too tested :) No
4503 Windows uses). This is good, but hasn't been too tested :) No
4491 fancy installer yet, I'll put a note in the manual so people at
4504 fancy installer yet, I'll put a note in the manual so people at
4492 least make manually a shortcut.
4505 least make manually a shortcut.
4493
4506
4494 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4507 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4495 into a single one, "colors". This now controls both prompt and
4508 into a single one, "colors". This now controls both prompt and
4496 exception color schemes, and can be changed both at startup
4509 exception color schemes, and can be changed both at startup
4497 (either via command-line switches or via ipythonrc files) and at
4510 (either via command-line switches or via ipythonrc files) and at
4498 runtime, with @colors.
4511 runtime, with @colors.
4499 (Magic.magic_run): renamed @prun to @run and removed the old
4512 (Magic.magic_run): renamed @prun to @run and removed the old
4500 @run. The two were too similar to warrant keeping both.
4513 @run. The two were too similar to warrant keeping both.
4501
4514
4502 2002-02-03 Fernando Perez <fperez@colorado.edu>
4515 2002-02-03 Fernando Perez <fperez@colorado.edu>
4503
4516
4504 * IPython/iplib.py (install_first_time): Added comment on how to
4517 * IPython/iplib.py (install_first_time): Added comment on how to
4505 configure the color options for first-time users. Put a <return>
4518 configure the color options for first-time users. Put a <return>
4506 request at the end so that small-terminal users get a chance to
4519 request at the end so that small-terminal users get a chance to
4507 read the startup info.
4520 read the startup info.
4508
4521
4509 2002-01-23 Fernando Perez <fperez@colorado.edu>
4522 2002-01-23 Fernando Perez <fperez@colorado.edu>
4510
4523
4511 * IPython/iplib.py (CachedOutput.update): Changed output memory
4524 * IPython/iplib.py (CachedOutput.update): Changed output memory
4512 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4525 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4513 input history we still use _i. Did this b/c these variable are
4526 input history we still use _i. Did this b/c these variable are
4514 very commonly used in interactive work, so the less we need to
4527 very commonly used in interactive work, so the less we need to
4515 type the better off we are.
4528 type the better off we are.
4516 (Magic.magic_prun): updated @prun to better handle the namespaces
4529 (Magic.magic_prun): updated @prun to better handle the namespaces
4517 the file will run in, including a fix for __name__ not being set
4530 the file will run in, including a fix for __name__ not being set
4518 before.
4531 before.
4519
4532
4520 2002-01-20 Fernando Perez <fperez@colorado.edu>
4533 2002-01-20 Fernando Perez <fperez@colorado.edu>
4521
4534
4522 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4535 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4523 extra garbage for Python 2.2. Need to look more carefully into
4536 extra garbage for Python 2.2. Need to look more carefully into
4524 this later.
4537 this later.
4525
4538
4526 2002-01-19 Fernando Perez <fperez@colorado.edu>
4539 2002-01-19 Fernando Perez <fperez@colorado.edu>
4527
4540
4528 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4541 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4529 display SyntaxError exceptions properly formatted when they occur
4542 display SyntaxError exceptions properly formatted when they occur
4530 (they can be triggered by imported code).
4543 (they can be triggered by imported code).
4531
4544
4532 2002-01-18 Fernando Perez <fperez@colorado.edu>
4545 2002-01-18 Fernando Perez <fperez@colorado.edu>
4533
4546
4534 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4547 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4535 SyntaxError exceptions are reported nicely formatted, instead of
4548 SyntaxError exceptions are reported nicely formatted, instead of
4536 spitting out only offset information as before.
4549 spitting out only offset information as before.
4537 (Magic.magic_prun): Added the @prun function for executing
4550 (Magic.magic_prun): Added the @prun function for executing
4538 programs with command line args inside IPython.
4551 programs with command line args inside IPython.
4539
4552
4540 2002-01-16 Fernando Perez <fperez@colorado.edu>
4553 2002-01-16 Fernando Perez <fperez@colorado.edu>
4541
4554
4542 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4555 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4543 to *not* include the last item given in a range. This brings their
4556 to *not* include the last item given in a range. This brings their
4544 behavior in line with Python's slicing:
4557 behavior in line with Python's slicing:
4545 a[n1:n2] -> a[n1]...a[n2-1]
4558 a[n1:n2] -> a[n1]...a[n2-1]
4546 It may be a bit less convenient, but I prefer to stick to Python's
4559 It may be a bit less convenient, but I prefer to stick to Python's
4547 conventions *everywhere*, so users never have to wonder.
4560 conventions *everywhere*, so users never have to wonder.
4548 (Magic.magic_macro): Added @macro function to ease the creation of
4561 (Magic.magic_macro): Added @macro function to ease the creation of
4549 macros.
4562 macros.
4550
4563
4551 2002-01-05 Fernando Perez <fperez@colorado.edu>
4564 2002-01-05 Fernando Perez <fperez@colorado.edu>
4552
4565
4553 * Released 0.2.4.
4566 * Released 0.2.4.
4554
4567
4555 * IPython/iplib.py (Magic.magic_pdef):
4568 * IPython/iplib.py (Magic.magic_pdef):
4556 (InteractiveShell.safe_execfile): report magic lines and error
4569 (InteractiveShell.safe_execfile): report magic lines and error
4557 lines without line numbers so one can easily copy/paste them for
4570 lines without line numbers so one can easily copy/paste them for
4558 re-execution.
4571 re-execution.
4559
4572
4560 * Updated manual with recent changes.
4573 * Updated manual with recent changes.
4561
4574
4562 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4575 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4563 docstring printing when class? is called. Very handy for knowing
4576 docstring printing when class? is called. Very handy for knowing
4564 how to create class instances (as long as __init__ is well
4577 how to create class instances (as long as __init__ is well
4565 documented, of course :)
4578 documented, of course :)
4566 (Magic.magic_doc): print both class and constructor docstrings.
4579 (Magic.magic_doc): print both class and constructor docstrings.
4567 (Magic.magic_pdef): give constructor info if passed a class and
4580 (Magic.magic_pdef): give constructor info if passed a class and
4568 __call__ info for callable object instances.
4581 __call__ info for callable object instances.
4569
4582
4570 2002-01-04 Fernando Perez <fperez@colorado.edu>
4583 2002-01-04 Fernando Perez <fperez@colorado.edu>
4571
4584
4572 * Made deep_reload() off by default. It doesn't always work
4585 * Made deep_reload() off by default. It doesn't always work
4573 exactly as intended, so it's probably safer to have it off. It's
4586 exactly as intended, so it's probably safer to have it off. It's
4574 still available as dreload() anyway, so nothing is lost.
4587 still available as dreload() anyway, so nothing is lost.
4575
4588
4576 2002-01-02 Fernando Perez <fperez@colorado.edu>
4589 2002-01-02 Fernando Perez <fperez@colorado.edu>
4577
4590
4578 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4591 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4579 so I wanted an updated release).
4592 so I wanted an updated release).
4580
4593
4581 2001-12-27 Fernando Perez <fperez@colorado.edu>
4594 2001-12-27 Fernando Perez <fperez@colorado.edu>
4582
4595
4583 * IPython/iplib.py (InteractiveShell.interact): Added the original
4596 * IPython/iplib.py (InteractiveShell.interact): Added the original
4584 code from 'code.py' for this module in order to change the
4597 code from 'code.py' for this module in order to change the
4585 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4598 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4586 the history cache would break when the user hit Ctrl-C, and
4599 the history cache would break when the user hit Ctrl-C, and
4587 interact() offers no way to add any hooks to it.
4600 interact() offers no way to add any hooks to it.
4588
4601
4589 2001-12-23 Fernando Perez <fperez@colorado.edu>
4602 2001-12-23 Fernando Perez <fperez@colorado.edu>
4590
4603
4591 * setup.py: added check for 'MANIFEST' before trying to remove
4604 * setup.py: added check for 'MANIFEST' before trying to remove
4592 it. Thanks to Sean Reifschneider.
4605 it. Thanks to Sean Reifschneider.
4593
4606
4594 2001-12-22 Fernando Perez <fperez@colorado.edu>
4607 2001-12-22 Fernando Perez <fperez@colorado.edu>
4595
4608
4596 * Released 0.2.2.
4609 * Released 0.2.2.
4597
4610
4598 * Finished (reasonably) writing the manual. Later will add the
4611 * Finished (reasonably) writing the manual. Later will add the
4599 python-standard navigation stylesheets, but for the time being
4612 python-standard navigation stylesheets, but for the time being
4600 it's fairly complete. Distribution will include html and pdf
4613 it's fairly complete. Distribution will include html and pdf
4601 versions.
4614 versions.
4602
4615
4603 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4616 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4604 (MayaVi author).
4617 (MayaVi author).
4605
4618
4606 2001-12-21 Fernando Perez <fperez@colorado.edu>
4619 2001-12-21 Fernando Perez <fperez@colorado.edu>
4607
4620
4608 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4621 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4609 good public release, I think (with the manual and the distutils
4622 good public release, I think (with the manual and the distutils
4610 installer). The manual can use some work, but that can go
4623 installer). The manual can use some work, but that can go
4611 slowly. Otherwise I think it's quite nice for end users. Next
4624 slowly. Otherwise I think it's quite nice for end users. Next
4612 summer, rewrite the guts of it...
4625 summer, rewrite the guts of it...
4613
4626
4614 * Changed format of ipythonrc files to use whitespace as the
4627 * Changed format of ipythonrc files to use whitespace as the
4615 separator instead of an explicit '='. Cleaner.
4628 separator instead of an explicit '='. Cleaner.
4616
4629
4617 2001-12-20 Fernando Perez <fperez@colorado.edu>
4630 2001-12-20 Fernando Perez <fperez@colorado.edu>
4618
4631
4619 * Started a manual in LyX. For now it's just a quick merge of the
4632 * Started a manual in LyX. For now it's just a quick merge of the
4620 various internal docstrings and READMEs. Later it may grow into a
4633 various internal docstrings and READMEs. Later it may grow into a
4621 nice, full-blown manual.
4634 nice, full-blown manual.
4622
4635
4623 * Set up a distutils based installer. Installation should now be
4636 * Set up a distutils based installer. Installation should now be
4624 trivially simple for end-users.
4637 trivially simple for end-users.
4625
4638
4626 2001-12-11 Fernando Perez <fperez@colorado.edu>
4639 2001-12-11 Fernando Perez <fperez@colorado.edu>
4627
4640
4628 * Released 0.2.0. First public release, announced it at
4641 * Released 0.2.0. First public release, announced it at
4629 comp.lang.python. From now on, just bugfixes...
4642 comp.lang.python. From now on, just bugfixes...
4630
4643
4631 * Went through all the files, set copyright/license notices and
4644 * Went through all the files, set copyright/license notices and
4632 cleaned up things. Ready for release.
4645 cleaned up things. Ready for release.
4633
4646
4634 2001-12-10 Fernando Perez <fperez@colorado.edu>
4647 2001-12-10 Fernando Perez <fperez@colorado.edu>
4635
4648
4636 * Changed the first-time installer not to use tarfiles. It's more
4649 * Changed the first-time installer not to use tarfiles. It's more
4637 robust now and less unix-dependent. Also makes it easier for
4650 robust now and less unix-dependent. Also makes it easier for
4638 people to later upgrade versions.
4651 people to later upgrade versions.
4639
4652
4640 * Changed @exit to @abort to reflect the fact that it's pretty
4653 * Changed @exit to @abort to reflect the fact that it's pretty
4641 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4654 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4642 becomes significant only when IPyhton is embedded: in that case,
4655 becomes significant only when IPyhton is embedded: in that case,
4643 C-D closes IPython only, but @abort kills the enclosing program
4656 C-D closes IPython only, but @abort kills the enclosing program
4644 too (unless it had called IPython inside a try catching
4657 too (unless it had called IPython inside a try catching
4645 SystemExit).
4658 SystemExit).
4646
4659
4647 * Created Shell module which exposes the actuall IPython Shell
4660 * Created Shell module which exposes the actuall IPython Shell
4648 classes, currently the normal and the embeddable one. This at
4661 classes, currently the normal and the embeddable one. This at
4649 least offers a stable interface we won't need to change when
4662 least offers a stable interface we won't need to change when
4650 (later) the internals are rewritten. That rewrite will be confined
4663 (later) the internals are rewritten. That rewrite will be confined
4651 to iplib and ipmaker, but the Shell interface should remain as is.
4664 to iplib and ipmaker, but the Shell interface should remain as is.
4652
4665
4653 * Added embed module which offers an embeddable IPShell object,
4666 * Added embed module which offers an embeddable IPShell object,
4654 useful to fire up IPython *inside* a running program. Great for
4667 useful to fire up IPython *inside* a running program. Great for
4655 debugging or dynamical data analysis.
4668 debugging or dynamical data analysis.
4656
4669
4657 2001-12-08 Fernando Perez <fperez@colorado.edu>
4670 2001-12-08 Fernando Perez <fperez@colorado.edu>
4658
4671
4659 * Fixed small bug preventing seeing info from methods of defined
4672 * Fixed small bug preventing seeing info from methods of defined
4660 objects (incorrect namespace in _ofind()).
4673 objects (incorrect namespace in _ofind()).
4661
4674
4662 * Documentation cleanup. Moved the main usage docstrings to a
4675 * Documentation cleanup. Moved the main usage docstrings to a
4663 separate file, usage.py (cleaner to maintain, and hopefully in the
4676 separate file, usage.py (cleaner to maintain, and hopefully in the
4664 future some perlpod-like way of producing interactive, man and
4677 future some perlpod-like way of producing interactive, man and
4665 html docs out of it will be found).
4678 html docs out of it will be found).
4666
4679
4667 * Added @profile to see your profile at any time.
4680 * Added @profile to see your profile at any time.
4668
4681
4669 * Added @p as an alias for 'print'. It's especially convenient if
4682 * Added @p as an alias for 'print'. It's especially convenient if
4670 using automagic ('p x' prints x).
4683 using automagic ('p x' prints x).
4671
4684
4672 * Small cleanups and fixes after a pychecker run.
4685 * Small cleanups and fixes after a pychecker run.
4673
4686
4674 * Changed the @cd command to handle @cd - and @cd -<n> for
4687 * Changed the @cd command to handle @cd - and @cd -<n> for
4675 visiting any directory in _dh.
4688 visiting any directory in _dh.
4676
4689
4677 * Introduced _dh, a history of visited directories. @dhist prints
4690 * Introduced _dh, a history of visited directories. @dhist prints
4678 it out with numbers.
4691 it out with numbers.
4679
4692
4680 2001-12-07 Fernando Perez <fperez@colorado.edu>
4693 2001-12-07 Fernando Perez <fperez@colorado.edu>
4681
4694
4682 * Released 0.1.22
4695 * Released 0.1.22
4683
4696
4684 * Made initialization a bit more robust against invalid color
4697 * Made initialization a bit more robust against invalid color
4685 options in user input (exit, not traceback-crash).
4698 options in user input (exit, not traceback-crash).
4686
4699
4687 * Changed the bug crash reporter to write the report only in the
4700 * Changed the bug crash reporter to write the report only in the
4688 user's .ipython directory. That way IPython won't litter people's
4701 user's .ipython directory. That way IPython won't litter people's
4689 hard disks with crash files all over the place. Also print on
4702 hard disks with crash files all over the place. Also print on
4690 screen the necessary mail command.
4703 screen the necessary mail command.
4691
4704
4692 * With the new ultraTB, implemented LightBG color scheme for light
4705 * With the new ultraTB, implemented LightBG color scheme for light
4693 background terminals. A lot of people like white backgrounds, so I
4706 background terminals. A lot of people like white backgrounds, so I
4694 guess we should at least give them something readable.
4707 guess we should at least give them something readable.
4695
4708
4696 2001-12-06 Fernando Perez <fperez@colorado.edu>
4709 2001-12-06 Fernando Perez <fperez@colorado.edu>
4697
4710
4698 * Modified the structure of ultraTB. Now there's a proper class
4711 * Modified the structure of ultraTB. Now there's a proper class
4699 for tables of color schemes which allow adding schemes easily and
4712 for tables of color schemes which allow adding schemes easily and
4700 switching the active scheme without creating a new instance every
4713 switching the active scheme without creating a new instance every
4701 time (which was ridiculous). The syntax for creating new schemes
4714 time (which was ridiculous). The syntax for creating new schemes
4702 is also cleaner. I think ultraTB is finally done, with a clean
4715 is also cleaner. I think ultraTB is finally done, with a clean
4703 class structure. Names are also much cleaner (now there's proper
4716 class structure. Names are also much cleaner (now there's proper
4704 color tables, no need for every variable to also have 'color' in
4717 color tables, no need for every variable to also have 'color' in
4705 its name).
4718 its name).
4706
4719
4707 * Broke down genutils into separate files. Now genutils only
4720 * Broke down genutils into separate files. Now genutils only
4708 contains utility functions, and classes have been moved to their
4721 contains utility functions, and classes have been moved to their
4709 own files (they had enough independent functionality to warrant
4722 own files (they had enough independent functionality to warrant
4710 it): ConfigLoader, OutputTrap, Struct.
4723 it): ConfigLoader, OutputTrap, Struct.
4711
4724
4712 2001-12-05 Fernando Perez <fperez@colorado.edu>
4725 2001-12-05 Fernando Perez <fperez@colorado.edu>
4713
4726
4714 * IPython turns 21! Released version 0.1.21, as a candidate for
4727 * IPython turns 21! Released version 0.1.21, as a candidate for
4715 public consumption. If all goes well, release in a few days.
4728 public consumption. If all goes well, release in a few days.
4716
4729
4717 * Fixed path bug (files in Extensions/ directory wouldn't be found
4730 * Fixed path bug (files in Extensions/ directory wouldn't be found
4718 unless IPython/ was explicitly in sys.path).
4731 unless IPython/ was explicitly in sys.path).
4719
4732
4720 * Extended the FlexCompleter class as MagicCompleter to allow
4733 * Extended the FlexCompleter class as MagicCompleter to allow
4721 completion of @-starting lines.
4734 completion of @-starting lines.
4722
4735
4723 * Created __release__.py file as a central repository for release
4736 * Created __release__.py file as a central repository for release
4724 info that other files can read from.
4737 info that other files can read from.
4725
4738
4726 * Fixed small bug in logging: when logging was turned on in
4739 * Fixed small bug in logging: when logging was turned on in
4727 mid-session, old lines with special meanings (!@?) were being
4740 mid-session, old lines with special meanings (!@?) were being
4728 logged without the prepended comment, which is necessary since
4741 logged without the prepended comment, which is necessary since
4729 they are not truly valid python syntax. This should make session
4742 they are not truly valid python syntax. This should make session
4730 restores produce less errors.
4743 restores produce less errors.
4731
4744
4732 * The namespace cleanup forced me to make a FlexCompleter class
4745 * The namespace cleanup forced me to make a FlexCompleter class
4733 which is nothing but a ripoff of rlcompleter, but with selectable
4746 which is nothing but a ripoff of rlcompleter, but with selectable
4734 namespace (rlcompleter only works in __main__.__dict__). I'll try
4747 namespace (rlcompleter only works in __main__.__dict__). I'll try
4735 to submit a note to the authors to see if this change can be
4748 to submit a note to the authors to see if this change can be
4736 incorporated in future rlcompleter releases (Dec.6: done)
4749 incorporated in future rlcompleter releases (Dec.6: done)
4737
4750
4738 * More fixes to namespace handling. It was a mess! Now all
4751 * More fixes to namespace handling. It was a mess! Now all
4739 explicit references to __main__.__dict__ are gone (except when
4752 explicit references to __main__.__dict__ are gone (except when
4740 really needed) and everything is handled through the namespace
4753 really needed) and everything is handled through the namespace
4741 dicts in the IPython instance. We seem to be getting somewhere
4754 dicts in the IPython instance. We seem to be getting somewhere
4742 with this, finally...
4755 with this, finally...
4743
4756
4744 * Small documentation updates.
4757 * Small documentation updates.
4745
4758
4746 * Created the Extensions directory under IPython (with an
4759 * Created the Extensions directory under IPython (with an
4747 __init__.py). Put the PhysicalQ stuff there. This directory should
4760 __init__.py). Put the PhysicalQ stuff there. This directory should
4748 be used for all special-purpose extensions.
4761 be used for all special-purpose extensions.
4749
4762
4750 * File renaming:
4763 * File renaming:
4751 ipythonlib --> ipmaker
4764 ipythonlib --> ipmaker
4752 ipplib --> iplib
4765 ipplib --> iplib
4753 This makes a bit more sense in terms of what these files actually do.
4766 This makes a bit more sense in terms of what these files actually do.
4754
4767
4755 * Moved all the classes and functions in ipythonlib to ipplib, so
4768 * Moved all the classes and functions in ipythonlib to ipplib, so
4756 now ipythonlib only has make_IPython(). This will ease up its
4769 now ipythonlib only has make_IPython(). This will ease up its
4757 splitting in smaller functional chunks later.
4770 splitting in smaller functional chunks later.
4758
4771
4759 * Cleaned up (done, I think) output of @whos. Better column
4772 * Cleaned up (done, I think) output of @whos. Better column
4760 formatting, and now shows str(var) for as much as it can, which is
4773 formatting, and now shows str(var) for as much as it can, which is
4761 typically what one gets with a 'print var'.
4774 typically what one gets with a 'print var'.
4762
4775
4763 2001-12-04 Fernando Perez <fperez@colorado.edu>
4776 2001-12-04 Fernando Perez <fperez@colorado.edu>
4764
4777
4765 * Fixed namespace problems. Now builtin/IPyhton/user names get
4778 * Fixed namespace problems. Now builtin/IPyhton/user names get
4766 properly reported in their namespace. Internal namespace handling
4779 properly reported in their namespace. Internal namespace handling
4767 is finally getting decent (not perfect yet, but much better than
4780 is finally getting decent (not perfect yet, but much better than
4768 the ad-hoc mess we had).
4781 the ad-hoc mess we had).
4769
4782
4770 * Removed -exit option. If people just want to run a python
4783 * Removed -exit option. If people just want to run a python
4771 script, that's what the normal interpreter is for. Less
4784 script, that's what the normal interpreter is for. Less
4772 unnecessary options, less chances for bugs.
4785 unnecessary options, less chances for bugs.
4773
4786
4774 * Added a crash handler which generates a complete post-mortem if
4787 * Added a crash handler which generates a complete post-mortem if
4775 IPython crashes. This will help a lot in tracking bugs down the
4788 IPython crashes. This will help a lot in tracking bugs down the
4776 road.
4789 road.
4777
4790
4778 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4791 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4779 which were boud to functions being reassigned would bypass the
4792 which were boud to functions being reassigned would bypass the
4780 logger, breaking the sync of _il with the prompt counter. This
4793 logger, breaking the sync of _il with the prompt counter. This
4781 would then crash IPython later when a new line was logged.
4794 would then crash IPython later when a new line was logged.
4782
4795
4783 2001-12-02 Fernando Perez <fperez@colorado.edu>
4796 2001-12-02 Fernando Perez <fperez@colorado.edu>
4784
4797
4785 * Made IPython a package. This means people don't have to clutter
4798 * Made IPython a package. This means people don't have to clutter
4786 their sys.path with yet another directory. Changed the INSTALL
4799 their sys.path with yet another directory. Changed the INSTALL
4787 file accordingly.
4800 file accordingly.
4788
4801
4789 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4802 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4790 sorts its output (so @who shows it sorted) and @whos formats the
4803 sorts its output (so @who shows it sorted) and @whos formats the
4791 table according to the width of the first column. Nicer, easier to
4804 table according to the width of the first column. Nicer, easier to
4792 read. Todo: write a generic table_format() which takes a list of
4805 read. Todo: write a generic table_format() which takes a list of
4793 lists and prints it nicely formatted, with optional row/column
4806 lists and prints it nicely formatted, with optional row/column
4794 separators and proper padding and justification.
4807 separators and proper padding and justification.
4795
4808
4796 * Released 0.1.20
4809 * Released 0.1.20
4797
4810
4798 * Fixed bug in @log which would reverse the inputcache list (a
4811 * Fixed bug in @log which would reverse the inputcache list (a
4799 copy operation was missing).
4812 copy operation was missing).
4800
4813
4801 * Code cleanup. @config was changed to use page(). Better, since
4814 * Code cleanup. @config was changed to use page(). Better, since
4802 its output is always quite long.
4815 its output is always quite long.
4803
4816
4804 * Itpl is back as a dependency. I was having too many problems
4817 * Itpl is back as a dependency. I was having too many problems
4805 getting the parametric aliases to work reliably, and it's just
4818 getting the parametric aliases to work reliably, and it's just
4806 easier to code weird string operations with it than playing %()s
4819 easier to code weird string operations with it than playing %()s
4807 games. It's only ~6k, so I don't think it's too big a deal.
4820 games. It's only ~6k, so I don't think it's too big a deal.
4808
4821
4809 * Found (and fixed) a very nasty bug with history. !lines weren't
4822 * Found (and fixed) a very nasty bug with history. !lines weren't
4810 getting cached, and the out of sync caches would crash
4823 getting cached, and the out of sync caches would crash
4811 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4824 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4812 division of labor a bit better. Bug fixed, cleaner structure.
4825 division of labor a bit better. Bug fixed, cleaner structure.
4813
4826
4814 2001-12-01 Fernando Perez <fperez@colorado.edu>
4827 2001-12-01 Fernando Perez <fperez@colorado.edu>
4815
4828
4816 * Released 0.1.19
4829 * Released 0.1.19
4817
4830
4818 * Added option -n to @hist to prevent line number printing. Much
4831 * Added option -n to @hist to prevent line number printing. Much
4819 easier to copy/paste code this way.
4832 easier to copy/paste code this way.
4820
4833
4821 * Created global _il to hold the input list. Allows easy
4834 * Created global _il to hold the input list. Allows easy
4822 re-execution of blocks of code by slicing it (inspired by Janko's
4835 re-execution of blocks of code by slicing it (inspired by Janko's
4823 comment on 'macros').
4836 comment on 'macros').
4824
4837
4825 * Small fixes and doc updates.
4838 * Small fixes and doc updates.
4826
4839
4827 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4840 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4828 much too fragile with automagic. Handles properly multi-line
4841 much too fragile with automagic. Handles properly multi-line
4829 statements and takes parameters.
4842 statements and takes parameters.
4830
4843
4831 2001-11-30 Fernando Perez <fperez@colorado.edu>
4844 2001-11-30 Fernando Perez <fperez@colorado.edu>
4832
4845
4833 * Version 0.1.18 released.
4846 * Version 0.1.18 released.
4834
4847
4835 * Fixed nasty namespace bug in initial module imports.
4848 * Fixed nasty namespace bug in initial module imports.
4836
4849
4837 * Added copyright/license notes to all code files (except
4850 * Added copyright/license notes to all code files (except
4838 DPyGetOpt). For the time being, LGPL. That could change.
4851 DPyGetOpt). For the time being, LGPL. That could change.
4839
4852
4840 * Rewrote a much nicer README, updated INSTALL, cleaned up
4853 * Rewrote a much nicer README, updated INSTALL, cleaned up
4841 ipythonrc-* samples.
4854 ipythonrc-* samples.
4842
4855
4843 * Overall code/documentation cleanup. Basically ready for
4856 * Overall code/documentation cleanup. Basically ready for
4844 release. Only remaining thing: licence decision (LGPL?).
4857 release. Only remaining thing: licence decision (LGPL?).
4845
4858
4846 * Converted load_config to a class, ConfigLoader. Now recursion
4859 * Converted load_config to a class, ConfigLoader. Now recursion
4847 control is better organized. Doesn't include the same file twice.
4860 control is better organized. Doesn't include the same file twice.
4848
4861
4849 2001-11-29 Fernando Perez <fperez@colorado.edu>
4862 2001-11-29 Fernando Perez <fperez@colorado.edu>
4850
4863
4851 * Got input history working. Changed output history variables from
4864 * Got input history working. Changed output history variables from
4852 _p to _o so that _i is for input and _o for output. Just cleaner
4865 _p to _o so that _i is for input and _o for output. Just cleaner
4853 convention.
4866 convention.
4854
4867
4855 * Implemented parametric aliases. This pretty much allows the
4868 * Implemented parametric aliases. This pretty much allows the
4856 alias system to offer full-blown shell convenience, I think.
4869 alias system to offer full-blown shell convenience, I think.
4857
4870
4858 * Version 0.1.17 released, 0.1.18 opened.
4871 * Version 0.1.17 released, 0.1.18 opened.
4859
4872
4860 * dot_ipython/ipythonrc (alias): added documentation.
4873 * dot_ipython/ipythonrc (alias): added documentation.
4861 (xcolor): Fixed small bug (xcolors -> xcolor)
4874 (xcolor): Fixed small bug (xcolors -> xcolor)
4862
4875
4863 * Changed the alias system. Now alias is a magic command to define
4876 * Changed the alias system. Now alias is a magic command to define
4864 aliases just like the shell. Rationale: the builtin magics should
4877 aliases just like the shell. Rationale: the builtin magics should
4865 be there for things deeply connected to IPython's
4878 be there for things deeply connected to IPython's
4866 architecture. And this is a much lighter system for what I think
4879 architecture. And this is a much lighter system for what I think
4867 is the really important feature: allowing users to define quickly
4880 is the really important feature: allowing users to define quickly
4868 magics that will do shell things for them, so they can customize
4881 magics that will do shell things for them, so they can customize
4869 IPython easily to match their work habits. If someone is really
4882 IPython easily to match their work habits. If someone is really
4870 desperate to have another name for a builtin alias, they can
4883 desperate to have another name for a builtin alias, they can
4871 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4884 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4872 works.
4885 works.
4873
4886
4874 2001-11-28 Fernando Perez <fperez@colorado.edu>
4887 2001-11-28 Fernando Perez <fperez@colorado.edu>
4875
4888
4876 * Changed @file so that it opens the source file at the proper
4889 * Changed @file so that it opens the source file at the proper
4877 line. Since it uses less, if your EDITOR environment is
4890 line. Since it uses less, if your EDITOR environment is
4878 configured, typing v will immediately open your editor of choice
4891 configured, typing v will immediately open your editor of choice
4879 right at the line where the object is defined. Not as quick as
4892 right at the line where the object is defined. Not as quick as
4880 having a direct @edit command, but for all intents and purposes it
4893 having a direct @edit command, but for all intents and purposes it
4881 works. And I don't have to worry about writing @edit to deal with
4894 works. And I don't have to worry about writing @edit to deal with
4882 all the editors, less does that.
4895 all the editors, less does that.
4883
4896
4884 * Version 0.1.16 released, 0.1.17 opened.
4897 * Version 0.1.16 released, 0.1.17 opened.
4885
4898
4886 * Fixed some nasty bugs in the page/page_dumb combo that could
4899 * Fixed some nasty bugs in the page/page_dumb combo that could
4887 crash IPython.
4900 crash IPython.
4888
4901
4889 2001-11-27 Fernando Perez <fperez@colorado.edu>
4902 2001-11-27 Fernando Perez <fperez@colorado.edu>
4890
4903
4891 * Version 0.1.15 released, 0.1.16 opened.
4904 * Version 0.1.15 released, 0.1.16 opened.
4892
4905
4893 * Finally got ? and ?? to work for undefined things: now it's
4906 * Finally got ? and ?? to work for undefined things: now it's
4894 possible to type {}.get? and get information about the get method
4907 possible to type {}.get? and get information about the get method
4895 of dicts, or os.path? even if only os is defined (so technically
4908 of dicts, or os.path? even if only os is defined (so technically
4896 os.path isn't). Works at any level. For example, after import os,
4909 os.path isn't). Works at any level. For example, after import os,
4897 os?, os.path?, os.path.abspath? all work. This is great, took some
4910 os?, os.path?, os.path.abspath? all work. This is great, took some
4898 work in _ofind.
4911 work in _ofind.
4899
4912
4900 * Fixed more bugs with logging. The sanest way to do it was to add
4913 * Fixed more bugs with logging. The sanest way to do it was to add
4901 to @log a 'mode' parameter. Killed two in one shot (this mode
4914 to @log a 'mode' parameter. Killed two in one shot (this mode
4902 option was a request of Janko's). I think it's finally clean
4915 option was a request of Janko's). I think it's finally clean
4903 (famous last words).
4916 (famous last words).
4904
4917
4905 * Added a page_dumb() pager which does a decent job of paging on
4918 * Added a page_dumb() pager which does a decent job of paging on
4906 screen, if better things (like less) aren't available. One less
4919 screen, if better things (like less) aren't available. One less
4907 unix dependency (someday maybe somebody will port this to
4920 unix dependency (someday maybe somebody will port this to
4908 windows).
4921 windows).
4909
4922
4910 * Fixed problem in magic_log: would lock of logging out if log
4923 * Fixed problem in magic_log: would lock of logging out if log
4911 creation failed (because it would still think it had succeeded).
4924 creation failed (because it would still think it had succeeded).
4912
4925
4913 * Improved the page() function using curses to auto-detect screen
4926 * Improved the page() function using curses to auto-detect screen
4914 size. Now it can make a much better decision on whether to print
4927 size. Now it can make a much better decision on whether to print
4915 or page a string. Option screen_length was modified: a value 0
4928 or page a string. Option screen_length was modified: a value 0
4916 means auto-detect, and that's the default now.
4929 means auto-detect, and that's the default now.
4917
4930
4918 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4931 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4919 go out. I'll test it for a few days, then talk to Janko about
4932 go out. I'll test it for a few days, then talk to Janko about
4920 licences and announce it.
4933 licences and announce it.
4921
4934
4922 * Fixed the length of the auto-generated ---> prompt which appears
4935 * Fixed the length of the auto-generated ---> prompt which appears
4923 for auto-parens and auto-quotes. Getting this right isn't trivial,
4936 for auto-parens and auto-quotes. Getting this right isn't trivial,
4924 with all the color escapes, different prompt types and optional
4937 with all the color escapes, different prompt types and optional
4925 separators. But it seems to be working in all the combinations.
4938 separators. But it seems to be working in all the combinations.
4926
4939
4927 2001-11-26 Fernando Perez <fperez@colorado.edu>
4940 2001-11-26 Fernando Perez <fperez@colorado.edu>
4928
4941
4929 * Wrote a regexp filter to get option types from the option names
4942 * Wrote a regexp filter to get option types from the option names
4930 string. This eliminates the need to manually keep two duplicate
4943 string. This eliminates the need to manually keep two duplicate
4931 lists.
4944 lists.
4932
4945
4933 * Removed the unneeded check_option_names. Now options are handled
4946 * Removed the unneeded check_option_names. Now options are handled
4934 in a much saner manner and it's easy to visually check that things
4947 in a much saner manner and it's easy to visually check that things
4935 are ok.
4948 are ok.
4936
4949
4937 * Updated version numbers on all files I modified to carry a
4950 * Updated version numbers on all files I modified to carry a
4938 notice so Janko and Nathan have clear version markers.
4951 notice so Janko and Nathan have clear version markers.
4939
4952
4940 * Updated docstring for ultraTB with my changes. I should send
4953 * Updated docstring for ultraTB with my changes. I should send
4941 this to Nathan.
4954 this to Nathan.
4942
4955
4943 * Lots of small fixes. Ran everything through pychecker again.
4956 * Lots of small fixes. Ran everything through pychecker again.
4944
4957
4945 * Made loading of deep_reload an cmd line option. If it's not too
4958 * Made loading of deep_reload an cmd line option. If it's not too
4946 kosher, now people can just disable it. With -nodeep_reload it's
4959 kosher, now people can just disable it. With -nodeep_reload it's
4947 still available as dreload(), it just won't overwrite reload().
4960 still available as dreload(), it just won't overwrite reload().
4948
4961
4949 * Moved many options to the no| form (-opt and -noopt
4962 * Moved many options to the no| form (-opt and -noopt
4950 accepted). Cleaner.
4963 accepted). Cleaner.
4951
4964
4952 * Changed magic_log so that if called with no parameters, it uses
4965 * Changed magic_log so that if called with no parameters, it uses
4953 'rotate' mode. That way auto-generated logs aren't automatically
4966 'rotate' mode. That way auto-generated logs aren't automatically
4954 over-written. For normal logs, now a backup is made if it exists
4967 over-written. For normal logs, now a backup is made if it exists
4955 (only 1 level of backups). A new 'backup' mode was added to the
4968 (only 1 level of backups). A new 'backup' mode was added to the
4956 Logger class to support this. This was a request by Janko.
4969 Logger class to support this. This was a request by Janko.
4957
4970
4958 * Added @logoff/@logon to stop/restart an active log.
4971 * Added @logoff/@logon to stop/restart an active log.
4959
4972
4960 * Fixed a lot of bugs in log saving/replay. It was pretty
4973 * Fixed a lot of bugs in log saving/replay. It was pretty
4961 broken. Now special lines (!@,/) appear properly in the command
4974 broken. Now special lines (!@,/) appear properly in the command
4962 history after a log replay.
4975 history after a log replay.
4963
4976
4964 * Tried and failed to implement full session saving via pickle. My
4977 * Tried and failed to implement full session saving via pickle. My
4965 idea was to pickle __main__.__dict__, but modules can't be
4978 idea was to pickle __main__.__dict__, but modules can't be
4966 pickled. This would be a better alternative to replaying logs, but
4979 pickled. This would be a better alternative to replaying logs, but
4967 seems quite tricky to get to work. Changed -session to be called
4980 seems quite tricky to get to work. Changed -session to be called
4968 -logplay, which more accurately reflects what it does. And if we
4981 -logplay, which more accurately reflects what it does. And if we
4969 ever get real session saving working, -session is now available.
4982 ever get real session saving working, -session is now available.
4970
4983
4971 * Implemented color schemes for prompts also. As for tracebacks,
4984 * Implemented color schemes for prompts also. As for tracebacks,
4972 currently only NoColor and Linux are supported. But now the
4985 currently only NoColor and Linux are supported. But now the
4973 infrastructure is in place, based on a generic ColorScheme
4986 infrastructure is in place, based on a generic ColorScheme
4974 class. So writing and activating new schemes both for the prompts
4987 class. So writing and activating new schemes both for the prompts
4975 and the tracebacks should be straightforward.
4988 and the tracebacks should be straightforward.
4976
4989
4977 * Version 0.1.13 released, 0.1.14 opened.
4990 * Version 0.1.13 released, 0.1.14 opened.
4978
4991
4979 * Changed handling of options for output cache. Now counter is
4992 * Changed handling of options for output cache. Now counter is
4980 hardwired starting at 1 and one specifies the maximum number of
4993 hardwired starting at 1 and one specifies the maximum number of
4981 entries *in the outcache* (not the max prompt counter). This is
4994 entries *in the outcache* (not the max prompt counter). This is
4982 much better, since many statements won't increase the cache
4995 much better, since many statements won't increase the cache
4983 count. It also eliminated some confusing options, now there's only
4996 count. It also eliminated some confusing options, now there's only
4984 one: cache_size.
4997 one: cache_size.
4985
4998
4986 * Added 'alias' magic function and magic_alias option in the
4999 * Added 'alias' magic function and magic_alias option in the
4987 ipythonrc file. Now the user can easily define whatever names he
5000 ipythonrc file. Now the user can easily define whatever names he
4988 wants for the magic functions without having to play weird
5001 wants for the magic functions without having to play weird
4989 namespace games. This gives IPython a real shell-like feel.
5002 namespace games. This gives IPython a real shell-like feel.
4990
5003
4991 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5004 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4992 @ or not).
5005 @ or not).
4993
5006
4994 This was one of the last remaining 'visible' bugs (that I know
5007 This was one of the last remaining 'visible' bugs (that I know
4995 of). I think if I can clean up the session loading so it works
5008 of). I think if I can clean up the session loading so it works
4996 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5009 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4997 about licensing).
5010 about licensing).
4998
5011
4999 2001-11-25 Fernando Perez <fperez@colorado.edu>
5012 2001-11-25 Fernando Perez <fperez@colorado.edu>
5000
5013
5001 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5014 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5002 there's a cleaner distinction between what ? and ?? show.
5015 there's a cleaner distinction between what ? and ?? show.
5003
5016
5004 * Added screen_length option. Now the user can define his own
5017 * Added screen_length option. Now the user can define his own
5005 screen size for page() operations.
5018 screen size for page() operations.
5006
5019
5007 * Implemented magic shell-like functions with automatic code
5020 * Implemented magic shell-like functions with automatic code
5008 generation. Now adding another function is just a matter of adding
5021 generation. Now adding another function is just a matter of adding
5009 an entry to a dict, and the function is dynamically generated at
5022 an entry to a dict, and the function is dynamically generated at
5010 run-time. Python has some really cool features!
5023 run-time. Python has some really cool features!
5011
5024
5012 * Renamed many options to cleanup conventions a little. Now all
5025 * Renamed many options to cleanup conventions a little. Now all
5013 are lowercase, and only underscores where needed. Also in the code
5026 are lowercase, and only underscores where needed. Also in the code
5014 option name tables are clearer.
5027 option name tables are clearer.
5015
5028
5016 * Changed prompts a little. Now input is 'In [n]:' instead of
5029 * Changed prompts a little. Now input is 'In [n]:' instead of
5017 'In[n]:='. This allows it the numbers to be aligned with the
5030 'In[n]:='. This allows it the numbers to be aligned with the
5018 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5031 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5019 Python (it was a Mathematica thing). The '...' continuation prompt
5032 Python (it was a Mathematica thing). The '...' continuation prompt
5020 was also changed a little to align better.
5033 was also changed a little to align better.
5021
5034
5022 * Fixed bug when flushing output cache. Not all _p<n> variables
5035 * Fixed bug when flushing output cache. Not all _p<n> variables
5023 exist, so their deletion needs to be wrapped in a try:
5036 exist, so their deletion needs to be wrapped in a try:
5024
5037
5025 * Figured out how to properly use inspect.formatargspec() (it
5038 * Figured out how to properly use inspect.formatargspec() (it
5026 requires the args preceded by *). So I removed all the code from
5039 requires the args preceded by *). So I removed all the code from
5027 _get_pdef in Magic, which was just replicating that.
5040 _get_pdef in Magic, which was just replicating that.
5028
5041
5029 * Added test to prefilter to allow redefining magic function names
5042 * Added test to prefilter to allow redefining magic function names
5030 as variables. This is ok, since the @ form is always available,
5043 as variables. This is ok, since the @ form is always available,
5031 but whe should allow the user to define a variable called 'ls' if
5044 but whe should allow the user to define a variable called 'ls' if
5032 he needs it.
5045 he needs it.
5033
5046
5034 * Moved the ToDo information from README into a separate ToDo.
5047 * Moved the ToDo information from README into a separate ToDo.
5035
5048
5036 * General code cleanup and small bugfixes. I think it's close to a
5049 * General code cleanup and small bugfixes. I think it's close to a
5037 state where it can be released, obviously with a big 'beta'
5050 state where it can be released, obviously with a big 'beta'
5038 warning on it.
5051 warning on it.
5039
5052
5040 * Got the magic function split to work. Now all magics are defined
5053 * Got the magic function split to work. Now all magics are defined
5041 in a separate class. It just organizes things a bit, and now
5054 in a separate class. It just organizes things a bit, and now
5042 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5055 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5043 was too long).
5056 was too long).
5044
5057
5045 * Changed @clear to @reset to avoid potential confusions with
5058 * Changed @clear to @reset to avoid potential confusions with
5046 the shell command clear. Also renamed @cl to @clear, which does
5059 the shell command clear. Also renamed @cl to @clear, which does
5047 exactly what people expect it to from their shell experience.
5060 exactly what people expect it to from their shell experience.
5048
5061
5049 Added a check to the @reset command (since it's so
5062 Added a check to the @reset command (since it's so
5050 destructive, it's probably a good idea to ask for confirmation).
5063 destructive, it's probably a good idea to ask for confirmation).
5051 But now reset only works for full namespace resetting. Since the
5064 But now reset only works for full namespace resetting. Since the
5052 del keyword is already there for deleting a few specific
5065 del keyword is already there for deleting a few specific
5053 variables, I don't see the point of having a redundant magic
5066 variables, I don't see the point of having a redundant magic
5054 function for the same task.
5067 function for the same task.
5055
5068
5056 2001-11-24 Fernando Perez <fperez@colorado.edu>
5069 2001-11-24 Fernando Perez <fperez@colorado.edu>
5057
5070
5058 * Updated the builtin docs (esp. the ? ones).
5071 * Updated the builtin docs (esp. the ? ones).
5059
5072
5060 * Ran all the code through pychecker. Not terribly impressed with
5073 * Ran all the code through pychecker. Not terribly impressed with
5061 it: lots of spurious warnings and didn't really find anything of
5074 it: lots of spurious warnings and didn't really find anything of
5062 substance (just a few modules being imported and not used).
5075 substance (just a few modules being imported and not used).
5063
5076
5064 * Implemented the new ultraTB functionality into IPython. New
5077 * Implemented the new ultraTB functionality into IPython. New
5065 option: xcolors. This chooses color scheme. xmode now only selects
5078 option: xcolors. This chooses color scheme. xmode now only selects
5066 between Plain and Verbose. Better orthogonality.
5079 between Plain and Verbose. Better orthogonality.
5067
5080
5068 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5081 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5069 mode and color scheme for the exception handlers. Now it's
5082 mode and color scheme for the exception handlers. Now it's
5070 possible to have the verbose traceback with no coloring.
5083 possible to have the verbose traceback with no coloring.
5071
5084
5072 2001-11-23 Fernando Perez <fperez@colorado.edu>
5085 2001-11-23 Fernando Perez <fperez@colorado.edu>
5073
5086
5074 * Version 0.1.12 released, 0.1.13 opened.
5087 * Version 0.1.12 released, 0.1.13 opened.
5075
5088
5076 * Removed option to set auto-quote and auto-paren escapes by
5089 * Removed option to set auto-quote and auto-paren escapes by
5077 user. The chances of breaking valid syntax are just too high. If
5090 user. The chances of breaking valid syntax are just too high. If
5078 someone *really* wants, they can always dig into the code.
5091 someone *really* wants, they can always dig into the code.
5079
5092
5080 * Made prompt separators configurable.
5093 * Made prompt separators configurable.
5081
5094
5082 2001-11-22 Fernando Perez <fperez@colorado.edu>
5095 2001-11-22 Fernando Perez <fperez@colorado.edu>
5083
5096
5084 * Small bugfixes in many places.
5097 * Small bugfixes in many places.
5085
5098
5086 * Removed the MyCompleter class from ipplib. It seemed redundant
5099 * Removed the MyCompleter class from ipplib. It seemed redundant
5087 with the C-p,C-n history search functionality. Less code to
5100 with the C-p,C-n history search functionality. Less code to
5088 maintain.
5101 maintain.
5089
5102
5090 * Moved all the original ipython.py code into ipythonlib.py. Right
5103 * Moved all the original ipython.py code into ipythonlib.py. Right
5091 now it's just one big dump into a function called make_IPython, so
5104 now it's just one big dump into a function called make_IPython, so
5092 no real modularity has been gained. But at least it makes the
5105 no real modularity has been gained. But at least it makes the
5093 wrapper script tiny, and since ipythonlib is a module, it gets
5106 wrapper script tiny, and since ipythonlib is a module, it gets
5094 compiled and startup is much faster.
5107 compiled and startup is much faster.
5095
5108
5096 This is a reasobably 'deep' change, so we should test it for a
5109 This is a reasobably 'deep' change, so we should test it for a
5097 while without messing too much more with the code.
5110 while without messing too much more with the code.
5098
5111
5099 2001-11-21 Fernando Perez <fperez@colorado.edu>
5112 2001-11-21 Fernando Perez <fperez@colorado.edu>
5100
5113
5101 * Version 0.1.11 released, 0.1.12 opened for further work.
5114 * Version 0.1.11 released, 0.1.12 opened for further work.
5102
5115
5103 * Removed dependency on Itpl. It was only needed in one place. It
5116 * Removed dependency on Itpl. It was only needed in one place. It
5104 would be nice if this became part of python, though. It makes life
5117 would be nice if this became part of python, though. It makes life
5105 *a lot* easier in some cases.
5118 *a lot* easier in some cases.
5106
5119
5107 * Simplified the prefilter code a bit. Now all handlers are
5120 * Simplified the prefilter code a bit. Now all handlers are
5108 expected to explicitly return a value (at least a blank string).
5121 expected to explicitly return a value (at least a blank string).
5109
5122
5110 * Heavy edits in ipplib. Removed the help system altogether. Now
5123 * Heavy edits in ipplib. Removed the help system altogether. Now
5111 obj?/?? is used for inspecting objects, a magic @doc prints
5124 obj?/?? is used for inspecting objects, a magic @doc prints
5112 docstrings, and full-blown Python help is accessed via the 'help'
5125 docstrings, and full-blown Python help is accessed via the 'help'
5113 keyword. This cleans up a lot of code (less to maintain) and does
5126 keyword. This cleans up a lot of code (less to maintain) and does
5114 the job. Since 'help' is now a standard Python component, might as
5127 the job. Since 'help' is now a standard Python component, might as
5115 well use it and remove duplicate functionality.
5128 well use it and remove duplicate functionality.
5116
5129
5117 Also removed the option to use ipplib as a standalone program. By
5130 Also removed the option to use ipplib as a standalone program. By
5118 now it's too dependent on other parts of IPython to function alone.
5131 now it's too dependent on other parts of IPython to function alone.
5119
5132
5120 * Fixed bug in genutils.pager. It would crash if the pager was
5133 * Fixed bug in genutils.pager. It would crash if the pager was
5121 exited immediately after opening (broken pipe).
5134 exited immediately after opening (broken pipe).
5122
5135
5123 * Trimmed down the VerboseTB reporting a little. The header is
5136 * Trimmed down the VerboseTB reporting a little. The header is
5124 much shorter now and the repeated exception arguments at the end
5137 much shorter now and the repeated exception arguments at the end
5125 have been removed. For interactive use the old header seemed a bit
5138 have been removed. For interactive use the old header seemed a bit
5126 excessive.
5139 excessive.
5127
5140
5128 * Fixed small bug in output of @whos for variables with multi-word
5141 * Fixed small bug in output of @whos for variables with multi-word
5129 types (only first word was displayed).
5142 types (only first word was displayed).
5130
5143
5131 2001-11-17 Fernando Perez <fperez@colorado.edu>
5144 2001-11-17 Fernando Perez <fperez@colorado.edu>
5132
5145
5133 * Version 0.1.10 released, 0.1.11 opened for further work.
5146 * Version 0.1.10 released, 0.1.11 opened for further work.
5134
5147
5135 * Modified dirs and friends. dirs now *returns* the stack (not
5148 * Modified dirs and friends. dirs now *returns* the stack (not
5136 prints), so one can manipulate it as a variable. Convenient to
5149 prints), so one can manipulate it as a variable. Convenient to
5137 travel along many directories.
5150 travel along many directories.
5138
5151
5139 * Fixed bug in magic_pdef: would only work with functions with
5152 * Fixed bug in magic_pdef: would only work with functions with
5140 arguments with default values.
5153 arguments with default values.
5141
5154
5142 2001-11-14 Fernando Perez <fperez@colorado.edu>
5155 2001-11-14 Fernando Perez <fperez@colorado.edu>
5143
5156
5144 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5157 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5145 example with IPython. Various other minor fixes and cleanups.
5158 example with IPython. Various other minor fixes and cleanups.
5146
5159
5147 * Version 0.1.9 released, 0.1.10 opened for further work.
5160 * Version 0.1.9 released, 0.1.10 opened for further work.
5148
5161
5149 * Added sys.path to the list of directories searched in the
5162 * Added sys.path to the list of directories searched in the
5150 execfile= option. It used to be the current directory and the
5163 execfile= option. It used to be the current directory and the
5151 user's IPYTHONDIR only.
5164 user's IPYTHONDIR only.
5152
5165
5153 2001-11-13 Fernando Perez <fperez@colorado.edu>
5166 2001-11-13 Fernando Perez <fperez@colorado.edu>
5154
5167
5155 * Reinstated the raw_input/prefilter separation that Janko had
5168 * Reinstated the raw_input/prefilter separation that Janko had
5156 initially. This gives a more convenient setup for extending the
5169 initially. This gives a more convenient setup for extending the
5157 pre-processor from the outside: raw_input always gets a string,
5170 pre-processor from the outside: raw_input always gets a string,
5158 and prefilter has to process it. We can then redefine prefilter
5171 and prefilter has to process it. We can then redefine prefilter
5159 from the outside and implement extensions for special
5172 from the outside and implement extensions for special
5160 purposes.
5173 purposes.
5161
5174
5162 Today I got one for inputting PhysicalQuantity objects
5175 Today I got one for inputting PhysicalQuantity objects
5163 (from Scientific) without needing any function calls at
5176 (from Scientific) without needing any function calls at
5164 all. Extremely convenient, and it's all done as a user-level
5177 all. Extremely convenient, and it's all done as a user-level
5165 extension (no IPython code was touched). Now instead of:
5178 extension (no IPython code was touched). Now instead of:
5166 a = PhysicalQuantity(4.2,'m/s**2')
5179 a = PhysicalQuantity(4.2,'m/s**2')
5167 one can simply say
5180 one can simply say
5168 a = 4.2 m/s**2
5181 a = 4.2 m/s**2
5169 or even
5182 or even
5170 a = 4.2 m/s^2
5183 a = 4.2 m/s^2
5171
5184
5172 I use this, but it's also a proof of concept: IPython really is
5185 I use this, but it's also a proof of concept: IPython really is
5173 fully user-extensible, even at the level of the parsing of the
5186 fully user-extensible, even at the level of the parsing of the
5174 command line. It's not trivial, but it's perfectly doable.
5187 command line. It's not trivial, but it's perfectly doable.
5175
5188
5176 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5189 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5177 the problem of modules being loaded in the inverse order in which
5190 the problem of modules being loaded in the inverse order in which
5178 they were defined in
5191 they were defined in
5179
5192
5180 * Version 0.1.8 released, 0.1.9 opened for further work.
5193 * Version 0.1.8 released, 0.1.9 opened for further work.
5181
5194
5182 * Added magics pdef, source and file. They respectively show the
5195 * Added magics pdef, source and file. They respectively show the
5183 definition line ('prototype' in C), source code and full python
5196 definition line ('prototype' in C), source code and full python
5184 file for any callable object. The object inspector oinfo uses
5197 file for any callable object. The object inspector oinfo uses
5185 these to show the same information.
5198 these to show the same information.
5186
5199
5187 * Version 0.1.7 released, 0.1.8 opened for further work.
5200 * Version 0.1.7 released, 0.1.8 opened for further work.
5188
5201
5189 * Separated all the magic functions into a class called Magic. The
5202 * Separated all the magic functions into a class called Magic. The
5190 InteractiveShell class was becoming too big for Xemacs to handle
5203 InteractiveShell class was becoming too big for Xemacs to handle
5191 (de-indenting a line would lock it up for 10 seconds while it
5204 (de-indenting a line would lock it up for 10 seconds while it
5192 backtracked on the whole class!)
5205 backtracked on the whole class!)
5193
5206
5194 FIXME: didn't work. It can be done, but right now namespaces are
5207 FIXME: didn't work. It can be done, but right now namespaces are
5195 all messed up. Do it later (reverted it for now, so at least
5208 all messed up. Do it later (reverted it for now, so at least
5196 everything works as before).
5209 everything works as before).
5197
5210
5198 * Got the object introspection system (magic_oinfo) working! I
5211 * Got the object introspection system (magic_oinfo) working! I
5199 think this is pretty much ready for release to Janko, so he can
5212 think this is pretty much ready for release to Janko, so he can
5200 test it for a while and then announce it. Pretty much 100% of what
5213 test it for a while and then announce it. Pretty much 100% of what
5201 I wanted for the 'phase 1' release is ready. Happy, tired.
5214 I wanted for the 'phase 1' release is ready. Happy, tired.
5202
5215
5203 2001-11-12 Fernando Perez <fperez@colorado.edu>
5216 2001-11-12 Fernando Perez <fperez@colorado.edu>
5204
5217
5205 * Version 0.1.6 released, 0.1.7 opened for further work.
5218 * Version 0.1.6 released, 0.1.7 opened for further work.
5206
5219
5207 * Fixed bug in printing: it used to test for truth before
5220 * Fixed bug in printing: it used to test for truth before
5208 printing, so 0 wouldn't print. Now checks for None.
5221 printing, so 0 wouldn't print. Now checks for None.
5209
5222
5210 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5223 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5211 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5224 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5212 reaches by hand into the outputcache. Think of a better way to do
5225 reaches by hand into the outputcache. Think of a better way to do
5213 this later.
5226 this later.
5214
5227
5215 * Various small fixes thanks to Nathan's comments.
5228 * Various small fixes thanks to Nathan's comments.
5216
5229
5217 * Changed magic_pprint to magic_Pprint. This way it doesn't
5230 * Changed magic_pprint to magic_Pprint. This way it doesn't
5218 collide with pprint() and the name is consistent with the command
5231 collide with pprint() and the name is consistent with the command
5219 line option.
5232 line option.
5220
5233
5221 * Changed prompt counter behavior to be fully like
5234 * Changed prompt counter behavior to be fully like
5222 Mathematica's. That is, even input that doesn't return a result
5235 Mathematica's. That is, even input that doesn't return a result
5223 raises the prompt counter. The old behavior was kind of confusing
5236 raises the prompt counter. The old behavior was kind of confusing
5224 (getting the same prompt number several times if the operation
5237 (getting the same prompt number several times if the operation
5225 didn't return a result).
5238 didn't return a result).
5226
5239
5227 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5240 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5228
5241
5229 * Fixed -Classic mode (wasn't working anymore).
5242 * Fixed -Classic mode (wasn't working anymore).
5230
5243
5231 * Added colored prompts using Nathan's new code. Colors are
5244 * Added colored prompts using Nathan's new code. Colors are
5232 currently hardwired, they can be user-configurable. For
5245 currently hardwired, they can be user-configurable. For
5233 developers, they can be chosen in file ipythonlib.py, at the
5246 developers, they can be chosen in file ipythonlib.py, at the
5234 beginning of the CachedOutput class def.
5247 beginning of the CachedOutput class def.
5235
5248
5236 2001-11-11 Fernando Perez <fperez@colorado.edu>
5249 2001-11-11 Fernando Perez <fperez@colorado.edu>
5237
5250
5238 * Version 0.1.5 released, 0.1.6 opened for further work.
5251 * Version 0.1.5 released, 0.1.6 opened for further work.
5239
5252
5240 * Changed magic_env to *return* the environment as a dict (not to
5253 * Changed magic_env to *return* the environment as a dict (not to
5241 print it). This way it prints, but it can also be processed.
5254 print it). This way it prints, but it can also be processed.
5242
5255
5243 * Added Verbose exception reporting to interactive
5256 * Added Verbose exception reporting to interactive
5244 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5257 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5245 traceback. Had to make some changes to the ultraTB file. This is
5258 traceback. Had to make some changes to the ultraTB file. This is
5246 probably the last 'big' thing in my mental todo list. This ties
5259 probably the last 'big' thing in my mental todo list. This ties
5247 in with the next entry:
5260 in with the next entry:
5248
5261
5249 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5262 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5250 has to specify is Plain, Color or Verbose for all exception
5263 has to specify is Plain, Color or Verbose for all exception
5251 handling.
5264 handling.
5252
5265
5253 * Removed ShellServices option. All this can really be done via
5266 * Removed ShellServices option. All this can really be done via
5254 the magic system. It's easier to extend, cleaner and has automatic
5267 the magic system. It's easier to extend, cleaner and has automatic
5255 namespace protection and documentation.
5268 namespace protection and documentation.
5256
5269
5257 2001-11-09 Fernando Perez <fperez@colorado.edu>
5270 2001-11-09 Fernando Perez <fperez@colorado.edu>
5258
5271
5259 * Fixed bug in output cache flushing (missing parameter to
5272 * Fixed bug in output cache flushing (missing parameter to
5260 __init__). Other small bugs fixed (found using pychecker).
5273 __init__). Other small bugs fixed (found using pychecker).
5261
5274
5262 * Version 0.1.4 opened for bugfixing.
5275 * Version 0.1.4 opened for bugfixing.
5263
5276
5264 2001-11-07 Fernando Perez <fperez@colorado.edu>
5277 2001-11-07 Fernando Perez <fperez@colorado.edu>
5265
5278
5266 * Version 0.1.3 released, mainly because of the raw_input bug.
5279 * Version 0.1.3 released, mainly because of the raw_input bug.
5267
5280
5268 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5281 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5269 and when testing for whether things were callable, a call could
5282 and when testing for whether things were callable, a call could
5270 actually be made to certain functions. They would get called again
5283 actually be made to certain functions. They would get called again
5271 once 'really' executed, with a resulting double call. A disaster
5284 once 'really' executed, with a resulting double call. A disaster
5272 in many cases (list.reverse() would never work!).
5285 in many cases (list.reverse() would never work!).
5273
5286
5274 * Removed prefilter() function, moved its code to raw_input (which
5287 * Removed prefilter() function, moved its code to raw_input (which
5275 after all was just a near-empty caller for prefilter). This saves
5288 after all was just a near-empty caller for prefilter). This saves
5276 a function call on every prompt, and simplifies the class a tiny bit.
5289 a function call on every prompt, and simplifies the class a tiny bit.
5277
5290
5278 * Fix _ip to __ip name in magic example file.
5291 * Fix _ip to __ip name in magic example file.
5279
5292
5280 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5293 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5281 work with non-gnu versions of tar.
5294 work with non-gnu versions of tar.
5282
5295
5283 2001-11-06 Fernando Perez <fperez@colorado.edu>
5296 2001-11-06 Fernando Perez <fperez@colorado.edu>
5284
5297
5285 * Version 0.1.2. Just to keep track of the recent changes.
5298 * Version 0.1.2. Just to keep track of the recent changes.
5286
5299
5287 * Fixed nasty bug in output prompt routine. It used to check 'if
5300 * Fixed nasty bug in output prompt routine. It used to check 'if
5288 arg != None...'. Problem is, this fails if arg implements a
5301 arg != None...'. Problem is, this fails if arg implements a
5289 special comparison (__cmp__) which disallows comparing to
5302 special comparison (__cmp__) which disallows comparing to
5290 None. Found it when trying to use the PhysicalQuantity module from
5303 None. Found it when trying to use the PhysicalQuantity module from
5291 ScientificPython.
5304 ScientificPython.
5292
5305
5293 2001-11-05 Fernando Perez <fperez@colorado.edu>
5306 2001-11-05 Fernando Perez <fperez@colorado.edu>
5294
5307
5295 * Also added dirs. Now the pushd/popd/dirs family functions
5308 * Also added dirs. Now the pushd/popd/dirs family functions
5296 basically like the shell, with the added convenience of going home
5309 basically like the shell, with the added convenience of going home
5297 when called with no args.
5310 when called with no args.
5298
5311
5299 * pushd/popd slightly modified to mimic shell behavior more
5312 * pushd/popd slightly modified to mimic shell behavior more
5300 closely.
5313 closely.
5301
5314
5302 * Added env,pushd,popd from ShellServices as magic functions. I
5315 * Added env,pushd,popd from ShellServices as magic functions. I
5303 think the cleanest will be to port all desired functions from
5316 think the cleanest will be to port all desired functions from
5304 ShellServices as magics and remove ShellServices altogether. This
5317 ShellServices as magics and remove ShellServices altogether. This
5305 will provide a single, clean way of adding functionality
5318 will provide a single, clean way of adding functionality
5306 (shell-type or otherwise) to IP.
5319 (shell-type or otherwise) to IP.
5307
5320
5308 2001-11-04 Fernando Perez <fperez@colorado.edu>
5321 2001-11-04 Fernando Perez <fperez@colorado.edu>
5309
5322
5310 * Added .ipython/ directory to sys.path. This way users can keep
5323 * Added .ipython/ directory to sys.path. This way users can keep
5311 customizations there and access them via import.
5324 customizations there and access them via import.
5312
5325
5313 2001-11-03 Fernando Perez <fperez@colorado.edu>
5326 2001-11-03 Fernando Perez <fperez@colorado.edu>
5314
5327
5315 * Opened version 0.1.1 for new changes.
5328 * Opened version 0.1.1 for new changes.
5316
5329
5317 * Changed version number to 0.1.0: first 'public' release, sent to
5330 * Changed version number to 0.1.0: first 'public' release, sent to
5318 Nathan and Janko.
5331 Nathan and Janko.
5319
5332
5320 * Lots of small fixes and tweaks.
5333 * Lots of small fixes and tweaks.
5321
5334
5322 * Minor changes to whos format. Now strings are shown, snipped if
5335 * Minor changes to whos format. Now strings are shown, snipped if
5323 too long.
5336 too long.
5324
5337
5325 * Changed ShellServices to work on __main__ so they show up in @who
5338 * Changed ShellServices to work on __main__ so they show up in @who
5326
5339
5327 * Help also works with ? at the end of a line:
5340 * Help also works with ? at the end of a line:
5328 ?sin and sin?
5341 ?sin and sin?
5329 both produce the same effect. This is nice, as often I use the
5342 both produce the same effect. This is nice, as often I use the
5330 tab-complete to find the name of a method, but I used to then have
5343 tab-complete to find the name of a method, but I used to then have
5331 to go to the beginning of the line to put a ? if I wanted more
5344 to go to the beginning of the line to put a ? if I wanted more
5332 info. Now I can just add the ? and hit return. Convenient.
5345 info. Now I can just add the ? and hit return. Convenient.
5333
5346
5334 2001-11-02 Fernando Perez <fperez@colorado.edu>
5347 2001-11-02 Fernando Perez <fperez@colorado.edu>
5335
5348
5336 * Python version check (>=2.1) added.
5349 * Python version check (>=2.1) added.
5337
5350
5338 * Added LazyPython documentation. At this point the docs are quite
5351 * Added LazyPython documentation. At this point the docs are quite
5339 a mess. A cleanup is in order.
5352 a mess. A cleanup is in order.
5340
5353
5341 * Auto-installer created. For some bizarre reason, the zipfiles
5354 * Auto-installer created. For some bizarre reason, the zipfiles
5342 module isn't working on my system. So I made a tar version
5355 module isn't working on my system. So I made a tar version
5343 (hopefully the command line options in various systems won't kill
5356 (hopefully the command line options in various systems won't kill
5344 me).
5357 me).
5345
5358
5346 * Fixes to Struct in genutils. Now all dictionary-like methods are
5359 * Fixes to Struct in genutils. Now all dictionary-like methods are
5347 protected (reasonably).
5360 protected (reasonably).
5348
5361
5349 * Added pager function to genutils and changed ? to print usage
5362 * Added pager function to genutils and changed ? to print usage
5350 note through it (it was too long).
5363 note through it (it was too long).
5351
5364
5352 * Added the LazyPython functionality. Works great! I changed the
5365 * Added the LazyPython functionality. Works great! I changed the
5353 auto-quote escape to ';', it's on home row and next to '. But
5366 auto-quote escape to ';', it's on home row and next to '. But
5354 both auto-quote and auto-paren (still /) escapes are command-line
5367 both auto-quote and auto-paren (still /) escapes are command-line
5355 parameters.
5368 parameters.
5356
5369
5357
5370
5358 2001-11-01 Fernando Perez <fperez@colorado.edu>
5371 2001-11-01 Fernando Perez <fperez@colorado.edu>
5359
5372
5360 * Version changed to 0.0.7. Fairly large change: configuration now
5373 * Version changed to 0.0.7. Fairly large change: configuration now
5361 is all stored in a directory, by default .ipython. There, all
5374 is all stored in a directory, by default .ipython. There, all
5362 config files have normal looking names (not .names)
5375 config files have normal looking names (not .names)
5363
5376
5364 * Version 0.0.6 Released first to Lucas and Archie as a test
5377 * Version 0.0.6 Released first to Lucas and Archie as a test
5365 run. Since it's the first 'semi-public' release, change version to
5378 run. Since it's the first 'semi-public' release, change version to
5366 > 0.0.6 for any changes now.
5379 > 0.0.6 for any changes now.
5367
5380
5368 * Stuff I had put in the ipplib.py changelog:
5381 * Stuff I had put in the ipplib.py changelog:
5369
5382
5370 Changes to InteractiveShell:
5383 Changes to InteractiveShell:
5371
5384
5372 - Made the usage message a parameter.
5385 - Made the usage message a parameter.
5373
5386
5374 - Require the name of the shell variable to be given. It's a bit
5387 - Require the name of the shell variable to be given. It's a bit
5375 of a hack, but allows the name 'shell' not to be hardwire in the
5388 of a hack, but allows the name 'shell' not to be hardwire in the
5376 magic (@) handler, which is problematic b/c it requires
5389 magic (@) handler, which is problematic b/c it requires
5377 polluting the global namespace with 'shell'. This in turn is
5390 polluting the global namespace with 'shell'. This in turn is
5378 fragile: if a user redefines a variable called shell, things
5391 fragile: if a user redefines a variable called shell, things
5379 break.
5392 break.
5380
5393
5381 - magic @: all functions available through @ need to be defined
5394 - magic @: all functions available through @ need to be defined
5382 as magic_<name>, even though they can be called simply as
5395 as magic_<name>, even though they can be called simply as
5383 @<name>. This allows the special command @magic to gather
5396 @<name>. This allows the special command @magic to gather
5384 information automatically about all existing magic functions,
5397 information automatically about all existing magic functions,
5385 even if they are run-time user extensions, by parsing the shell
5398 even if they are run-time user extensions, by parsing the shell
5386 instance __dict__ looking for special magic_ names.
5399 instance __dict__ looking for special magic_ names.
5387
5400
5388 - mainloop: added *two* local namespace parameters. This allows
5401 - mainloop: added *two* local namespace parameters. This allows
5389 the class to differentiate between parameters which were there
5402 the class to differentiate between parameters which were there
5390 before and after command line initialization was processed. This
5403 before and after command line initialization was processed. This
5391 way, later @who can show things loaded at startup by the
5404 way, later @who can show things loaded at startup by the
5392 user. This trick was necessary to make session saving/reloading
5405 user. This trick was necessary to make session saving/reloading
5393 really work: ideally after saving/exiting/reloading a session,
5406 really work: ideally after saving/exiting/reloading a session,
5394 *everythin* should look the same, including the output of @who. I
5407 *everythin* should look the same, including the output of @who. I
5395 was only able to make this work with this double namespace
5408 was only able to make this work with this double namespace
5396 trick.
5409 trick.
5397
5410
5398 - added a header to the logfile which allows (almost) full
5411 - added a header to the logfile which allows (almost) full
5399 session restoring.
5412 session restoring.
5400
5413
5401 - prepend lines beginning with @ or !, with a and log
5414 - prepend lines beginning with @ or !, with a and log
5402 them. Why? !lines: may be useful to know what you did @lines:
5415 them. Why? !lines: may be useful to know what you did @lines:
5403 they may affect session state. So when restoring a session, at
5416 they may affect session state. So when restoring a session, at
5404 least inform the user of their presence. I couldn't quite get
5417 least inform the user of their presence. I couldn't quite get
5405 them to properly re-execute, but at least the user is warned.
5418 them to properly re-execute, but at least the user is warned.
5406
5419
5407 * Started ChangeLog.
5420 * Started ChangeLog.
@@ -1,402 +1,408 b''
1 ;;; ipython.el --- Adds support for IPython to python-mode.el
1 ;;; ipython.el --- Adds support for IPython to python-mode.el
2
2
3 ;; Copyright (C) 2002, 2003, 2004, 2005 Alexander Schmolck
3 ;; Copyright (C) 2002, 2003, 2004, 2005 Alexander Schmolck
4 ;; Author: Alexander Schmolck
4 ;; Author: Alexander Schmolck
5 ;; Keywords: ipython python languages oop
5 ;; Keywords: ipython python languages oop
6 ;; URL: http://ipython.scipy.org
6 ;; URL: http://ipython.scipy.org
7 ;; Compatibility: Emacs21, XEmacs21
7 ;; Compatibility: Emacs21, XEmacs21
8 ;; FIXME: #$@! INPUT RING
8 ;; FIXME: #$@! INPUT RING
9 (defconst ipython-version "$Revision: 1211 $"
9 (defconst ipython-version "$Revision: 1324 $"
10 "VC version number.")
10 "VC version number.")
11
11
12 ;;; Commentary
12 ;;; Commentary
13 ;; This library makes all the functionality python-mode has when running with
13 ;; This library makes all the functionality python-mode has when running with
14 ;; the normal python-interpreter available for ipython, too. It also enables a
14 ;; the normal python-interpreter available for ipython, too. It also enables a
15 ;; persistent py-shell command history accross sessions (if you exit python
15 ;; persistent py-shell command history accross sessions (if you exit python
16 ;; with C-d in py-shell) and defines the command `ipython-to-doctest', which
16 ;; with C-d in py-shell) and defines the command `ipython-to-doctest', which
17 ;; can be used to convert bits of a ipython session into something that can be
17 ;; can be used to convert bits of a ipython session into something that can be
18 ;; used for doctests. To install, put this file somewhere in your emacs
18 ;; used for doctests. To install, put this file somewhere in your emacs
19 ;; `load-path' [1] and add the following line to your ~/.emacs file (the first
19 ;; `load-path' [1] and add the following line to your ~/.emacs file (the first
20 ;; line only needed if the default (``"ipython"``) is wrong)::
20 ;; line only needed if the default (``"ipython"``) is wrong)::
21 ;;
21 ;;
22 ;; (setq ipython-command "/SOME-PATH/ipython")
22 ;; (setq ipython-command "/SOME-PATH/ipython")
23 ;; (require 'ipython)
23 ;; (require 'ipython)
24 ;;
24 ;;
25 ;; Ipython will be set as the default python shell, but only if the ipython
25 ;; Ipython will be set as the default python shell, but only if the ipython
26 ;; executable is in the path. For ipython sessions autocompletion with <tab>
26 ;; executable is in the path. For ipython sessions autocompletion with <tab>
27 ;; is also enabled (experimental feature!). Please also note that all the
27 ;; is also enabled (experimental feature!). Please also note that all the
28 ;; terminal functions in py-shell are handled by emacs's comint, **not** by
28 ;; terminal functions in py-shell are handled by emacs's comint, **not** by
29 ;; (i)python, so importing readline etc. will have 0 effect.
29 ;; (i)python, so importing readline etc. will have 0 effect.
30 ;;
30 ;;
31 ;; To start an interactive ipython session run `py-shell' with ``M-x py-shell``
31 ;; To start an interactive ipython session run `py-shell' with ``M-x py-shell``
32 ;; (or the default keybinding ``C-c C-!``).
32 ;; (or the default keybinding ``C-c C-!``).
33 ;;
33 ;;
34 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
34 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
35 ;; will work fine for most cases, doing certain things (like the
35 ;; will work fine for most cases, doing certain things (like the
36 ;; autocompletion and a decent scheme to switch between python interpreters)
36 ;; autocompletion and a decent scheme to switch between python interpreters)
37 ;; properly will also require changes to ipython that will likely have to wait
37 ;; properly will also require changes to ipython that will likely have to wait
38 ;; for a larger rewrite scheduled some time in the future.
38 ;; for a larger rewrite scheduled some time in the future.
39 ;;
39 ;;
40 ;; Also note that you currently NEED THE CVS VERSION OF PYTHON.EL.
40 ;; Also note that you currently NEED THE CVS VERSION OF PYTHON.EL.
41 ;;
41 ;;
42 ;; Further note that I don't know whether this runs under windows or not and
42 ;; Further note that I don't know whether this runs under windows or not and
43 ;; that if it doesn't I can't really help much, not being afflicted myself.
43 ;; that if it doesn't I can't really help much, not being afflicted myself.
44 ;;
44 ;;
45 ;;
45 ;;
46 ;; Hints for effective usage
46 ;; Hints for effective usage
47 ;; -------------------------
47 ;; -------------------------
48 ;;
48 ;;
49 ;; - IMO the best feature by far of the ipython/emacs combo is how much easier it
49 ;; - IMO the best feature by far of the ipython/emacs combo is how much easier it
50 ;; makes it to find and fix bugs thanks to the ``@pdb on``/ pdbtrack combo. Try
50 ;; makes it to find and fix bugs thanks to the ``%pdb on``/ pdbtrack combo. Try
51 ;; it: first in the ipython to shell do ``@pdb on`` then do something that will
51 ;; it: first in the ipython to shell do ``%pdb on`` then do something that will
52 ;; raise an exception (FIXME nice example) -- and be amazed how easy it is to
52 ;; raise an exception (FIXME nice example) -- and be amazed how easy it is to
53 ;; inspect the live objects in each stack frames and to jump to the
53 ;; inspect the live objects in each stack frames and to jump to the
54 ;; corresponding sourcecode locations as you walk up and down the stack trace
54 ;; corresponding sourcecode locations as you walk up and down the stack trace
55 ;; (even without ``%pdb on`` you can always use ``C-c -`` (`py-up-exception')
55 ;; (even without ``%pdb on`` you can always use ``C-c -`` (`py-up-exception')
56 ;; to jump to the corresponding source code locations).
56 ;; to jump to the corresponding source code locations).
57 ;;
57 ;;
58 ;; - emacs gives you much more powerful commandline editing and output searching
58 ;; - emacs gives you much more powerful commandline editing and output searching
59 ;; capabilities than ipython-standalone -- isearch is your friend if you
59 ;; capabilities than ipython-standalone -- isearch is your friend if you
60 ;; quickly want to print 'DEBUG ...' to stdout out etc.
60 ;; quickly want to print 'DEBUG ...' to stdout out etc.
61 ;;
61 ;;
62 ;; - This is not really specific to ipython, but for more convenient history
62 ;; - This is not really specific to ipython, but for more convenient history
63 ;; access you might want to add something like the following to *the beggining*
63 ;; access you might want to add something like the following to *the beggining*
64 ;; of your ``.emacs`` (if you want behavior that's more similar to stand-alone
64 ;; of your ``.emacs`` (if you want behavior that's more similar to stand-alone
65 ;; ipython, you can change ``meta p`` etc. for ``control p``)::
65 ;; ipython, you can change ``meta p`` etc. for ``control p``)::
66 ;;
66 ;;
67 ;; (require 'comint)
67 ;; (require 'comint)
68 ;; (define-key comint-mode-map [(meta p)]
68 ;; (define-key comint-mode-map [(meta p)]
69 ;; 'comint-previous-matching-input-from-input)
69 ;; 'comint-previous-matching-input-from-input)
70 ;; (define-key comint-mode-map [(meta n)]
70 ;; (define-key comint-mode-map [(meta n)]
71 ;; 'comint-next-matching-input-from-input)
71 ;; 'comint-next-matching-input-from-input)
72 ;; (define-key comint-mode-map [(control meta n)]
72 ;; (define-key comint-mode-map [(control meta n)]
73 ;; 'comint-next-input)
73 ;; 'comint-next-input)
74 ;; (define-key comint-mode-map [(control meta p)]
74 ;; (define-key comint-mode-map [(control meta p)]
75 ;; 'comint-previous-input)
75 ;; 'comint-previous-input)
76 ;;
76 ;;
77 ;; - Be aware that if you customize py-python-command previously, this value
77 ;; - Be aware that if you customize py-python-command previously, this value
78 ;; will override what ipython.el does (because loading the customization
78 ;; will override what ipython.el does (because loading the customization
79 ;; variables comes later).
79 ;; variables comes later).
80 ;;
80 ;;
81 ;; Please send comments and feedback to the ipython-list
81 ;; Please send comments and feedback to the ipython-list
82 ;; (<ipython-user@scipy.net>) where I (a.s.) or someone else will try to
82 ;; (<ipython-user@scipy.net>) where I (a.s.) or someone else will try to
83 ;; answer them (it helps if you specify your emacs version, OS etc;
83 ;; answer them (it helps if you specify your emacs version, OS etc;
84 ;; familiarity with <http://www.catb.org/~esr/faqs/smart-questions.html> might
84 ;; familiarity with <http://www.catb.org/~esr/faqs/smart-questions.html> might
85 ;; speed up things further).
85 ;; speed up things further).
86 ;;
86 ;;
87 ;; Footnotes:
87 ;; Footnotes:
88 ;;
88 ;;
89 ;; [1] If you don't know what `load-path' is, C-h v load-path will tell
89 ;; [1] If you don't know what `load-path' is, C-h v load-path will tell
90 ;; you; if required you can also add a new directory. So assuming that
90 ;; you; if required you can also add a new directory. So assuming that
91 ;; ipython.el resides in ~/el/, put this in your emacs:
91 ;; ipython.el resides in ~/el/, put this in your emacs:
92 ;;
92 ;;
93 ;;
93 ;;
94 ;; (add-to-list 'load-path "~/el")
94 ;; (add-to-list 'load-path "~/el")
95 ;; (setq ipython-command "/some-path/ipython")
95 ;; (setq ipython-command "/some-path/ipython")
96 ;; (require 'ipython)
96 ;; (require 'ipython)
97 ;;
97 ;;
98 ;;
98 ;;
99 ;;
99 ;;
100 ;;
100 ;;
101 ;; TODO:
101 ;; TODO:
102 ;; - do autocompletion properly
102 ;; - do autocompletion properly
103 ;; - implement a proper switching between python interpreters
103 ;; - implement a proper switching between python interpreters
104 ;;
104 ;;
105 ;; BUGS:
105 ;; BUGS:
106 ;; - neither::
106 ;; - neither::
107 ;;
107 ;;
108 ;; (py-shell "-c print 'FOOBAR'")
108 ;; (py-shell "-c print 'FOOBAR'")
109 ;;
109 ;;
110 ;; nor::
110 ;; nor::
111 ;;
111 ;;
112 ;; (let ((py-python-command-args (append py-python-command-args
112 ;; (let ((py-python-command-args (append py-python-command-args
113 ;; '("-c" "print 'FOOBAR'"))))
113 ;; '("-c" "print 'FOOBAR'"))))
114 ;; (py-shell))
114 ;; (py-shell))
115 ;;
115 ;;
116 ;; seem to print anything as they should
116 ;; seem to print anything as they should
117 ;;
117 ;;
118 ;; - look into init priority issues with `py-python-command' (if it's set
118 ;; - look into init priority issues with `py-python-command' (if it's set
119 ;; via custom)
119 ;; via custom)
120
120
121
121
122 ;;; Code
122 ;;; Code
123 (require 'cl)
123 (require 'cl)
124 (require 'shell)
124 (require 'shell)
125 (require 'executable)
125 (require 'executable)
126 (require 'ansi-color)
126 (require 'ansi-color)
127
127
128 (defcustom ipython-command "ipython"
128 (defcustom ipython-command "ipython"
129 "*Shell command used to start ipython."
129 "*Shell command used to start ipython."
130 :type 'string
130 :type 'string
131 :group 'python)
131 :group 'python)
132
132
133 ;; Users can set this to nil
133 ;; Users can set this to nil
134 (defvar py-shell-initial-switch-buffers t
134 (defvar py-shell-initial-switch-buffers t
135 "If nil, don't switch to the *Python* buffer on the first call to
135 "If nil, don't switch to the *Python* buffer on the first call to
136 `py-shell'.")
136 `py-shell'.")
137
137
138 (defvar ipython-backup-of-py-python-command nil
138 (defvar ipython-backup-of-py-python-command nil
139 "HACK")
139 "HACK")
140
140
141
141
142 (defvar ipython-de-input-prompt-regexp "\\(?:
142 (defvar ipython-de-input-prompt-regexp "\\(?:
143 In \\[[0-9]+\\]: *.*
143 In \\[[0-9]+\\]: *.*
144 ----+> \\(.*
144 ----+> \\(.*
145 \\)[\n]?\\)\\|\\(?:
145 \\)[\n]?\\)\\|\\(?:
146 In \\[[0-9]+\\]: *\\(.*
146 In \\[[0-9]+\\]: *\\(.*
147 \\)\\)\\|^[ ]\\{3\\}[.]\\{3,\\}: *\\(.*
147 \\)\\)\\|^[ ]\\{3\\}[.]\\{3,\\}: *\\(.*
148 \\)"
148 \\)"
149 "A regular expression to match the IPython input prompt and the python
149 "A regular expression to match the IPython input prompt and the python
150 command after it. The first match group is for a command that is rewritten,
150 command after it. The first match group is for a command that is rewritten,
151 the second for a 'normal' command, and the third for a multiline command.")
151 the second for a 'normal' command, and the third for a multiline command.")
152 (defvar ipython-de-output-prompt-regexp "^Out\\[[0-9]+\\]: "
152 (defvar ipython-de-output-prompt-regexp "^Out\\[[0-9]+\\]: "
153 "A regular expression to match the output prompt of IPython.")
153 "A regular expression to match the output prompt of IPython.")
154
154
155
155
156 (if (not (executable-find ipython-command))
156 (if (not (executable-find ipython-command))
157 (message (format "Can't find executable %s - ipython.el *NOT* activated!!!"
157 (message (format "Can't find executable %s - ipython.el *NOT* activated!!!"
158 ipython-command))
158 ipython-command))
159 ;; XXX load python-mode, so that we can screw around with its variables
159 ;; XXX load python-mode, so that we can screw around with its variables
160 ;; this has the disadvantage that python-mode is loaded even if no
160 ;; this has the disadvantage that python-mode is loaded even if no
161 ;; python-file is ever edited etc. but it means that `py-shell' works
161 ;; python-file is ever edited etc. but it means that `py-shell' works
162 ;; without loading a python-file first. Obviously screwing around with
162 ;; without loading a python-file first. Obviously screwing around with
163 ;; python-mode's variables like this is a mess, but well.
163 ;; python-mode's variables like this is a mess, but well.
164 (require 'python-mode)
164 (require 'python-mode)
165 ;; turn on ansi colors for ipython and activate completion
165 ;; turn on ansi colors for ipython and activate completion
166 (defun ipython-shell-hook ()
166 (defun ipython-shell-hook ()
167 ;; the following is to synchronize dir-changes
167 ;; the following is to synchronize dir-changes
168 (make-local-variable 'shell-dirstack)
168 (make-local-variable 'shell-dirstack)
169 (setq shell-dirstack nil)
169 (setq shell-dirstack nil)
170 (make-local-variable 'shell-last-dir)
170 (make-local-variable 'shell-last-dir)
171 (setq shell-last-dir nil)
171 (setq shell-last-dir nil)
172 (make-local-variable 'shell-dirtrackp)
172 (make-local-variable 'shell-dirtrackp)
173 (setq shell-dirtrackp t)
173 (setq shell-dirtrackp t)
174 (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
174 (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
175
175
176 (ansi-color-for-comint-mode-on)
176 (ansi-color-for-comint-mode-on)
177 (define-key py-shell-map [tab] 'ipython-complete)
177 (define-key py-shell-map [tab] 'ipython-complete)
178 ;;XXX this is really just a cheap hack, it only completes symbols in the
178 ;;XXX this is really just a cheap hack, it only completes symbols in the
179 ;;interactive session -- useful nonetheless.
179 ;;interactive session -- useful nonetheless.
180 (define-key py-mode-map [(meta tab)] 'ipython-complete))
180 (define-key py-mode-map [(meta tab)] 'ipython-complete)
181
182 )
181 (add-hook 'py-shell-hook 'ipython-shell-hook)
183 (add-hook 'py-shell-hook 'ipython-shell-hook)
182 ;; Regular expression that describes tracebacks for IPython in context and
184 ;; Regular expression that describes tracebacks for IPython in context and
183 ;; verbose mode.
185 ;; verbose mode.
184
186
185 ;;Adapt python-mode settings for ipython.
187 ;;Adapt python-mode settings for ipython.
186 ;; (this works for %xmode 'verbose' or 'context')
188 ;; (this works for %xmode 'verbose' or 'context')
187
189
188 ;; XXX putative regexps for syntax errors; unfortunately the
190 ;; XXX putative regexps for syntax errors; unfortunately the
189 ;; current python-mode traceback-line-re scheme is too primitive,
191 ;; current python-mode traceback-line-re scheme is too primitive,
190 ;; so it's either matching syntax errors, *or* everything else
192 ;; so it's either matching syntax errors, *or* everything else
191 ;; (XXX: should ask Fernando for a change)
193 ;; (XXX: should ask Fernando for a change)
192 ;;"^ File \"\\(.*?\\)\", line \\([0-9]+\\).*\n.*\n.*\nSyntaxError:"
194 ;;"^ File \"\\(.*?\\)\", line \\([0-9]+\\).*\n.*\n.*\nSyntaxError:"
193 ;;^ File \"\\(.*?\\)\", line \\([0-9]+\\)"
195 ;;^ File \"\\(.*?\\)\", line \\([0-9]+\\)"
196
194 (setq py-traceback-line-re
197 (setq py-traceback-line-re
195 "\\(^[^\t ].+?\\.py\\).*\n +[0-9]+[^\00]*?\n-+> \\([0-9]+\\) +")
198 "\\(^[^\t ].+?\\.py\\).*\n +[0-9]+[^\00]*?\n-+> \\([0-9]+\\) +")
196
199
200 ;; Recognize the ipython pdb, whose prompt is 'ipdb>' instead of '(Pdb)'
201 (setq py-pdbtrack-input-prompt "\n[(<]*[Ii]?[Pp]db[>)]+ ")
202
197 (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
203 (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
198 py-shell-input-prompt-2-regexp "^ [.][.][.]+: *" )
204 py-shell-input-prompt-2-regexp "^ [.][.][.]+: *" )
199 ;; select a suitable color-scheme
205 ;; select a suitable color-scheme
200 (unless (member "-colors" py-python-command-args)
206 (unless (member "-colors" py-python-command-args)
201 (setq py-python-command-args
207 (setq py-python-command-args
202 (nconc py-python-command-args
208 (nconc py-python-command-args
203 (list "-colors"
209 (list "-colors"
204 (cond
210 (cond
205 ((eq frame-background-mode 'dark)
211 ((eq frame-background-mode 'dark)
206 "DarkBG")
212 "DarkBG")
207 ((eq frame-background-mode 'light)
213 ((eq frame-background-mode 'light)
208 "LightBG")
214 "LightBG")
209 (t ; default (backg-mode isn't always set by XEmacs)
215 (t ; default (backg-mode isn't always set by XEmacs)
210 "LightBG"))))))
216 "LightBG"))))))
211 (unless (equal ipython-backup-of-py-python-command py-python-command)
217 (unless (equal ipython-backup-of-py-python-command py-python-command)
212 (setq ipython-backup-of-py-python-command py-python-command))
218 (setq ipython-backup-of-py-python-command py-python-command))
213 (setq py-python-command ipython-command))
219 (setq py-python-command ipython-command))
214
220
215
221
216 ;; MODIFY py-shell so that it loads the editing history
222 ;; MODIFY py-shell so that it loads the editing history
217 (defadvice py-shell (around py-shell-with-history)
223 (defadvice py-shell (around py-shell-with-history)
218 "Add persistent command-history support (in
224 "Add persistent command-history support (in
219 $PYTHONHISTORY (or \"~/.ipython/history\", if we use IPython)). Also, if
225 $PYTHONHISTORY (or \"~/.ipython/history\", if we use IPython)). Also, if
220 `py-shell-initial-switch-buffers' is nil, it only switches to *Python* if that
226 `py-shell-initial-switch-buffers' is nil, it only switches to *Python* if that
221 buffer already exists."
227 buffer already exists."
222 (if (comint-check-proc "*Python*")
228 (if (comint-check-proc "*Python*")
223 ad-do-it
229 ad-do-it
224 (setq comint-input-ring-file-name
230 (setq comint-input-ring-file-name
225 (if (string-equal py-python-command ipython-command)
231 (if (string-equal py-python-command ipython-command)
226 (concat (or (getenv "IPYTHONDIR") "~/.ipython") "/history")
232 (concat (or (getenv "IPYTHONDIR") "~/.ipython") "/history")
227 (or (getenv "PYTHONHISTORY") "~/.python-history.py")))
233 (or (getenv "PYTHONHISTORY") "~/.python-history.py")))
228 (comint-read-input-ring t)
234 (comint-read-input-ring t)
229 (let ((buf (current-buffer)))
235 (let ((buf (current-buffer)))
230 ad-do-it
236 ad-do-it
231 (unless py-shell-initial-switch-buffers
237 (unless py-shell-initial-switch-buffers
232 (switch-to-buffer-other-window buf)))))
238 (switch-to-buffer-other-window buf)))))
233 (ad-activate 'py-shell)
239 (ad-activate 'py-shell)
234 ;; (defadvice py-execute-region (before py-execute-buffer-ensure-process)
240 ;; (defadvice py-execute-region (before py-execute-buffer-ensure-process)
235 ;; "HACK: test that ipython is already running before executing something.
241 ;; "HACK: test that ipython is already running before executing something.
236 ;; Doing this properly seems not worth the bother (unless people actually
242 ;; Doing this properly seems not worth the bother (unless people actually
237 ;; request it)."
243 ;; request it)."
238 ;; (unless (comint-check-proc "*Python*")
244 ;; (unless (comint-check-proc "*Python*")
239 ;; (error "Sorry you have to first do M-x py-shell to send something to ipython.")))
245 ;; (error "Sorry you have to first do M-x py-shell to send something to ipython.")))
240 ;; (ad-activate 'py-execute-region)
246 ;; (ad-activate 'py-execute-region)
241
247
242 (defadvice py-execute-region (around py-execute-buffer-ensure-process)
248 (defadvice py-execute-region (around py-execute-buffer-ensure-process)
243 "HACK: if `py-shell' is not active or ASYNC is explicitly desired, fall back
249 "HACK: if `py-shell' is not active or ASYNC is explicitly desired, fall back
244 to python instead of ipython."
250 to python instead of ipython."
245 (let ((py-python-command (if (and (comint-check-proc "*Python*") (not async))
251 (let ((py-python-command (if (and (comint-check-proc "*Python*") (not async))
246 py-python-command
252 py-python-command
247 ipython-backup-of-py-python-command)))
253 ipython-backup-of-py-python-command)))
248 ad-do-it))
254 ad-do-it))
249 (ad-activate 'py-execute-region)
255 (ad-activate 'py-execute-region)
250
256
251 (defun ipython-to-doctest (start end)
257 (defun ipython-to-doctest (start end)
252 "Transform a cut-and-pasted bit from an IPython session into something that
258 "Transform a cut-and-pasted bit from an IPython session into something that
253 looks like it came from a normal interactive python session, so that it can
259 looks like it came from a normal interactive python session, so that it can
254 be used in doctests. Example:
260 be used in doctests. Example:
255
261
256
262
257 In [1]: import sys
263 In [1]: import sys
258
264
259 In [2]: sys.stdout.write 'Hi!\n'
265 In [2]: sys.stdout.write 'Hi!\n'
260 ------> sys.stdout.write ('Hi!\n')
266 ------> sys.stdout.write ('Hi!\n')
261 Hi!
267 Hi!
262
268
263 In [3]: 3 + 4
269 In [3]: 3 + 4
264 Out[3]: 7
270 Out[3]: 7
265
271
266 gets converted to:
272 gets converted to:
267
273
268 >>> import sys
274 >>> import sys
269 >>> sys.stdout.write ('Hi!\n')
275 >>> sys.stdout.write ('Hi!\n')
270 Hi!
276 Hi!
271 >>> 3 + 4
277 >>> 3 + 4
272 7
278 7
273
279
274 "
280 "
275 (interactive "*r\n")
281 (interactive "*r\n")
276 ;(message (format "###DEBUG s:%de:%d" start end))
282 ;(message (format "###DEBUG s:%de:%d" start end))
277 (save-excursion
283 (save-excursion
278 (save-match-data
284 (save-match-data
279 ;; replace ``In [3]: bla`` with ``>>> bla`` and
285 ;; replace ``In [3]: bla`` with ``>>> bla`` and
280 ;; ``... : bla`` with ``... bla``
286 ;; ``... : bla`` with ``... bla``
281 (goto-char start)
287 (goto-char start)
282 (while (re-search-forward ipython-de-input-prompt-regexp end t)
288 (while (re-search-forward ipython-de-input-prompt-regexp end t)
283 ;(message "finding 1")
289 ;(message "finding 1")
284 (cond ((match-string 3) ;continued
290 (cond ((match-string 3) ;continued
285 (replace-match "... \\3" t nil))
291 (replace-match "... \\3" t nil))
286 (t
292 (t
287 (replace-match ">>> \\1\\2" t nil))))
293 (replace-match ">>> \\1\\2" t nil))))
288 ;; replace ``
294 ;; replace ``
289 (goto-char start)
295 (goto-char start)
290 (while (re-search-forward ipython-de-output-prompt-regexp end t)
296 (while (re-search-forward ipython-de-output-prompt-regexp end t)
291 (replace-match "" t nil)))))
297 (replace-match "" t nil)))))
292
298
293 (defvar ipython-completion-command-string
299 (defvar ipython-completion-command-string
294 "print ';'.join(__IP.Completer.all_completions('%s')) #PYTHON-MODE SILENT\n"
300 "print ';'.join(__IP.Completer.all_completions('%s')) #PYTHON-MODE SILENT\n"
295 "The string send to ipython to query for all possible completions")
301 "The string send to ipython to query for all possible completions")
296
302
297
303
298 ;; xemacs doesn't have `comint-preoutput-filter-functions' so we'll try the
304 ;; xemacs doesn't have `comint-preoutput-filter-functions' so we'll try the
299 ;; following wonderful hack to work around this case
305 ;; following wonderful hack to work around this case
300 (if (featurep 'xemacs)
306 (if (featurep 'xemacs)
301 ;;xemacs
307 ;;xemacs
302 (defun ipython-complete ()
308 (defun ipython-complete ()
303 "Try to complete the python symbol before point. Only knows about the stuff
309 "Try to complete the python symbol before point. Only knows about the stuff
304 in the current *Python* session."
310 in the current *Python* session."
305 (interactive)
311 (interactive)
306 (let* ((ugly-return nil)
312 (let* ((ugly-return nil)
307 (sep ";")
313 (sep ";")
308 (python-process (or (get-buffer-process (current-buffer))
314 (python-process (or (get-buffer-process (current-buffer))
309 ;XXX hack for .py buffers
315 ;XXX hack for .py buffers
310 (get-process py-which-bufname)))
316 (get-process py-which-bufname)))
311 ;; XXX currently we go backwards to find the beginning of an
317 ;; XXX currently we go backwards to find the beginning of an
312 ;; expression part; a more powerful approach in the future might be
318 ;; expression part; a more powerful approach in the future might be
313 ;; to let ipython have the complete line, so that context can be used
319 ;; to let ipython have the complete line, so that context can be used
314 ;; to do things like filename completion etc.
320 ;; to do things like filename completion etc.
315 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
321 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
316 (point)))
322 (point)))
317 (end (point))
323 (end (point))
318 (pattern (buffer-substring-no-properties beg end))
324 (pattern (buffer-substring-no-properties beg end))
319 (completions nil)
325 (completions nil)
320 (completion-table nil)
326 (completion-table nil)
321 completion
327 completion
322 (comint-output-filter-functions
328 (comint-output-filter-functions
323 (append comint-output-filter-functions
329 (append comint-output-filter-functions
324 '(ansi-color-filter-apply
330 '(ansi-color-filter-apply
325 (lambda (string)
331 (lambda (string)
326 ;(message (format "DEBUG filtering: %s" string))
332 ;(message (format "DEBUG filtering: %s" string))
327 (setq ugly-return (concat ugly-return string))
333 (setq ugly-return (concat ugly-return string))
328 (delete-region comint-last-output-start
334 (delete-region comint-last-output-start
329 (process-mark (get-buffer-process (current-buffer)))))))))
335 (process-mark (get-buffer-process (current-buffer)))))))))
330 ;(message (format "#DEBUG pattern: '%s'" pattern))
336 ;(message (format "#DEBUG pattern: '%s'" pattern))
331 (process-send-string python-process
337 (process-send-string python-process
332 (format ipython-completion-command-string pattern))
338 (format ipython-completion-command-string pattern))
333 (accept-process-output python-process)
339 (accept-process-output python-process)
334 ;(message (format "DEBUG return: %s" ugly-return))
340 ;(message (format "DEBUG return: %s" ugly-return))
335 (setq completions
341 (setq completions
336 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
342 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
337 (setq completion-table (loop for str in completions
343 (setq completion-table (loop for str in completions
338 collect (list str nil)))
344 collect (list str nil)))
339 (setq completion (try-completion pattern completion-table))
345 (setq completion (try-completion pattern completion-table))
340 (cond ((eq completion t))
346 (cond ((eq completion t))
341 ((null completion)
347 ((null completion)
342 (message "Can't find completion for \"%s\"" pattern)
348 (message "Can't find completion for \"%s\"" pattern)
343 (ding))
349 (ding))
344 ((not (string= pattern completion))
350 ((not (string= pattern completion))
345 (delete-region beg end)
351 (delete-region beg end)
346 (insert completion))
352 (insert completion))
347 (t
353 (t
348 (message "Making completion list...")
354 (message "Making completion list...")
349 (with-output-to-temp-buffer "*Python Completions*"
355 (with-output-to-temp-buffer "*Python Completions*"
350 (display-completion-list (all-completions pattern completion-table)))
356 (display-completion-list (all-completions pattern completion-table)))
351 (message "Making completion list...%s" "done")))))
357 (message "Making completion list...%s" "done")))))
352 ;; emacs
358 ;; emacs
353 (defun ipython-complete ()
359 (defun ipython-complete ()
354 "Try to complete the python symbol before point. Only knows about the stuff
360 "Try to complete the python symbol before point. Only knows about the stuff
355 in the current *Python* session."
361 in the current *Python* session."
356 (interactive)
362 (interactive)
357 (let* ((ugly-return nil)
363 (let* ((ugly-return nil)
358 (sep ";")
364 (sep ";")
359 (python-process (or (get-buffer-process (current-buffer))
365 (python-process (or (get-buffer-process (current-buffer))
360 ;XXX hack for .py buffers
366 ;XXX hack for .py buffers
361 (get-process py-which-bufname)))
367 (get-process py-which-bufname)))
362 ;; XXX currently we go backwards to find the beginning of an
368 ;; XXX currently we go backwards to find the beginning of an
363 ;; expression part; a more powerful approach in the future might be
369 ;; expression part; a more powerful approach in the future might be
364 ;; to let ipython have the complete line, so that context can be used
370 ;; to let ipython have the complete line, so that context can be used
365 ;; to do things like filename completion etc.
371 ;; to do things like filename completion etc.
366 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
372 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
367 (point)))
373 (point)))
368 (end (point))
374 (end (point))
369 (pattern (buffer-substring-no-properties beg end))
375 (pattern (buffer-substring-no-properties beg end))
370 (completions nil)
376 (completions nil)
371 (completion-table nil)
377 (completion-table nil)
372 completion
378 completion
373 (comint-preoutput-filter-functions
379 (comint-preoutput-filter-functions
374 (append comint-preoutput-filter-functions
380 (append comint-preoutput-filter-functions
375 '(ansi-color-filter-apply
381 '(ansi-color-filter-apply
376 (lambda (string)
382 (lambda (string)
377 (setq ugly-return (concat ugly-return string))
383 (setq ugly-return (concat ugly-return string))
378 "")))))
384 "")))))
379 (process-send-string python-process
385 (process-send-string python-process
380 (format ipython-completion-command-string pattern))
386 (format ipython-completion-command-string pattern))
381 (accept-process-output python-process)
387 (accept-process-output python-process)
382 (setq completions
388 (setq completions
383 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
389 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
384 ;(message (format "DEBUG completions: %S" completions))
390 ;(message (format "DEBUG completions: %S" completions))
385 (setq completion-table (loop for str in completions
391 (setq completion-table (loop for str in completions
386 collect (list str nil)))
392 collect (list str nil)))
387 (setq completion (try-completion pattern completion-table))
393 (setq completion (try-completion pattern completion-table))
388 (cond ((eq completion t))
394 (cond ((eq completion t))
389 ((null completion)
395 ((null completion)
390 (message "Can't find completion for \"%s\"" pattern)
396 (message "Can't find completion for \"%s\"" pattern)
391 (ding))
397 (ding))
392 ((not (string= pattern completion))
398 ((not (string= pattern completion))
393 (delete-region beg end)
399 (delete-region beg end)
394 (insert completion))
400 (insert completion))
395 (t
401 (t
396 (message "Making completion list...")
402 (message "Making completion list...")
397 (with-output-to-temp-buffer "*IPython Completions*"
403 (with-output-to-temp-buffer "*IPython Completions*"
398 (display-completion-list (all-completions pattern completion-table)))
404 (display-completion-list (all-completions pattern completion-table)))
399 (message "Making completion list...%s" "done")))))
405 (message "Making completion list...%s" "done")))))
400 )
406 )
401
407
402 (provide 'ipython)
408 (provide 'ipython)
General Comments 0
You need to be logged in to leave comments. Login now